Go to advanced search

by richiepp
Tue Jun 23, 2020 9:27 pm
Forum: General discussion
Topic: Copy and Paste not working in Putty
Replies: 6
Views: 313

Re: Copy and Paste not working in Putty

Awesome! That was it!
by richiepp
Tue Jun 23, 2020 9:03 pm
Forum: General discussion
Topic: Copy and Paste not working in Putty
Replies: 6
Views: 313

Copy and Paste not working in Putty

Hey All. I've been playing with Raspberry Pi for years and recently got a version 4 to run as a desktop. I'm transitioning from a Windows machine and have most of my staple programs working on the Pi however I'm having trouble with Putty. Copy and pasting is super easy in Putty on a windows machine,...
by richiepp
Fri May 29, 2020 8:19 pm
Forum: Python
Topic: Handling throtle errors from Adafruit
Replies: 1
Views: 191

Handling throtle errors from Adafruit

Hey All, I've got a python script that sends temperature data to adafruit.io . It works as intended for the most part but crashes occasionally. I live in a rural area where my internet can be flaky from time to time. As far as I can tell there are periods of slow connection and when things come back...
by richiepp
Wed May 20, 2020 12:21 am
Forum: Python
Topic: Motion sensor to call script for continuous lighting
Replies: 6
Views: 314

Re: Motion sensor to call script for continuous lighting

UPDATE
I just swapped out the PIR with a different one and it's working better. But still needs a bit more tweaking

The code runs but like the original the light goes LOW before it detects more movement and goes HIGH again.
by richiepp
Tue May 19, 2020 10:53 pm
Forum: Python
Topic: Motion sensor to call script for continuous lighting
Replies: 6
Views: 314

Re: Motion sensor to call script for continuous lighting

Hmm. I'm still not quite getting it to run properly. When I fire up the script the LED goes HIGH and stays HIGH. From the console I see the "Ready" prompt and when I move I get "Motion Detected" which quickly changes to "Motion detected again!" and the message scrolls forever and the script seems to...
by richiepp
Mon May 18, 2020 9:30 pm
Forum: Python
Topic: Motion sensor to call script for continuous lighting
Replies: 6
Views: 314

Re: Motion sensor to call script for continuous lighting

Ah yes, this is similar to how it's done in Arduino, C+; my native language so to speak. So I spent a couple of hours playing with the indenting on your suggested code and just couldn't get it to work. I suspect your suggested code will work if I can get the indents right. I looked at some tutorial ...
by richiepp
Mon May 18, 2020 2:15 am
Forum: Python
Topic: Motion sensor to call script for continuous lighting
Replies: 6
Views: 314

Motion sensor to call script for continuous lighting

Hey All. I'm using a motion sensor to turn on an LED. My hurdle right now is to have the led stay on for an interval, if more movement is detected I want to reset a timer to zero. I almost have this figured out by using 2 scripts, the first one detects motion and calls the second which turns the LED...
by richiepp
Fri May 15, 2020 9:38 pm
Forum: Automation, sensing and robotics
Topic: Programming Arduino from Raspi - Library troubles
Replies: 4
Views: 271

Re: Programming Arduino from Raspi - Library troubles

Yep, I was running an outdated version of Arduino.

Thanks!
by richiepp
Fri May 15, 2020 7:47 pm
Forum: Automation, sensing and robotics
Topic: Programming Arduino from Raspi - Library troubles
Replies: 4
Views: 271

Programming Arduino from Raspi - Library troubles

Hey All, I just installed Arduino on a Raspberry Pi 4 and it's blistering fast compared to my windows machine. However when I try to use custom libraries, especially ones that use hyphens and underscores in their names, I'm having trouble. Note that I've been playing with Arduino for 8-9 years and 5...
by richiepp
Fri Apr 17, 2020 2:22 pm
Forum: Python
Topic: Trouble using serial port data -- Python IF
Replies: 2
Views: 163

Re: Trouble using serial port data -- Python IF

That was it! Thanks Gordon!
by richiepp
Fri Apr 17, 2020 1:46 pm
Forum: Python
Topic: Trouble using serial port data -- Python IF
Replies: 2
Views: 163

Trouble using serial port data -- Python IF

Hey All, I'm working on getting my Arduino and Raspberry Pi to talk to each other over serial. I've got the basics figured out but I'm having trouble using the data the Pi receives from the Arduino. I've started modifying a bit of python to include a couple of IF statements but they don't seem to be...
by richiepp
Sat Sep 24, 2016 1:06 pm
Forum: Other programming languages
Topic: Node.js Thermostat
Replies: 2
Views: 1449

Re: Node.js Thermostat

I poked around here but didn't see anything that looked like it would work.
https://www.npmjs.com/search?q=thermostat&page=1
by richiepp
Mon Sep 12, 2016 5:40 pm
Forum: Other programming languages
Topic: Node.js Thermostat
Replies: 2
Views: 1449

Node.js Thermostat

Hey All, Thanks to Heater for working with me to use Node.js to render serial data from temp sensors hooked up to an Arduino. https://www.raspberrypi.org/forums/viewtopic.php?f=34&t=151184&p=1004116&hilit=richiepp#p1004116 Now that I have the temp sensors sending serial data from the Arduino to the ...
by richiepp
Sat Jul 02, 2016 6:59 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

Let me say more about my project. So this is a "home automation" project that will include a variety of sensors and switches. Each room in the house will have it's own web page that will render temperature and any other sensor data from that room. It'll also include a keypad to toggle lights and ren...
by richiepp
Sat Jul 02, 2016 5:22 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

Awesome it works in Safari now! Now that the data is flowing I can start playing with the layout and user interface. After trying to tweak the app.js aka the React script I'm finding it's a little more involved than just tweaking the html. I'll be reading up on react.js in the coming days. I'd like ...
by richiepp
Fri Jul 01, 2016 3:30 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

It Works!!!! Thanks so much Heater! Well, it mostly works.... When I pull it up in Safari on my iphone and ipad the page renders but the data does not. I get a status message that says "Fetching Data" and that's it. I tried it on a couple different ports; 8080 and 8888 and get the same result. I eve...
by richiepp
Sun Jun 26, 2016 2:19 pm
Forum: Other programming languages
Topic: Light switching @ Sunrise and Sunset
Replies: 8
Views: 5117

Re: Light switching @ Sunrise and Sunset

I continued building this out and it came to three files and a couple of cron jobs. Each day at 2a.m. I run the following php from a cron job. <?php $myfile = fopen("/usr/lib/cgi-bin/timers/srss_today.txt", "w") or die("Unable to open file!"); $txt = date_sunrise(time(), SUNFUNCS_RET_STRING, 42.3536...
by richiepp
Sun Jun 26, 2016 12:10 am
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

OK, I'm a few steps closer. My server and serialport script currently looks like the following. This works when I go to http://localhost:8080/temp and it renders the serial port data. var express = require('express'); var app = express(); var temperature; app.use(express.static('public')); app.liste...
by richiepp
Mon Jun 13, 2016 8:29 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

Another baby step. I've got the server set up and it renders the temperature and timestamp as expected. However the data it renders is static. I have to refresh the page to see an updated reading. var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hel...
by richiepp
Mon Jun 13, 2016 4:53 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

ok, here's what might be a dumb question, a fundamental Node.js question I guess. Where do I put the fetch code? Do I create a directory structure like this http://localhost/api/temperature and create and index.html file in the temperature directory. Or are all Node.js pages created on the fly with ...
by richiepp
Mon Jun 13, 2016 4:36 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

Baby steps. Ok, I've tried adding my serialport code to your server example and can get it working halfway. The way it's written now it shows the timestamp but not the contents of the serial stream 'use strict'; var serialport = require('serialport'); var SerialPort = serialport.SerialPort; var pars...
by richiepp
Mon Jun 13, 2016 2:04 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Re: Node.js, serialport, AJAX - Temp Sensor

Wow thanks for such a detailed response Heater! I started working through your notes and got the server up and running....easy enough. But I'm getting stuck at the second step. So here is the server code with the temperature function, note it doesn't work because "temp" is not defined. var express =...
by richiepp
Sat Jun 11, 2016 2:07 pm
Forum: Other programming languages
Topic: Light switching @ Sunrise and Sunset
Replies: 8
Views: 5117

Light switching @ Sunrise and Sunset

I'm developing an outdoor lighting system that turns lights on at sunset and truns them off at dawn. PHP has a function that returns the time for sunrise and sunset based on the coordinates you set. So I'm running a cron job at 2am daily to write to a file with that days times. So my log file for to...
by richiepp
Sat Jun 11, 2016 1:41 pm
Forum: Other programming languages
Topic: Node.js, serialport, AJAX - Temp Sensor
Replies: 23
Views: 11830

Node.js, serialport, AJAX - Temp Sensor

Hey All, I've started to play around with Node.js and the serialport module to communicate with an Arduino. I've got a temperature sensor on the Arduino that reads and sends a serial signal every second. I'm catching that signal and writing to a text file. I read that text file every second and retu...
by richiepp
Thu Jun 09, 2016 5:37 pm
Forum: Other programming languages
Topic: Struggling to get a node.js script running with forever at r
Replies: 1
Views: 1899

Struggling to get a node.js script running with forever at r

Hey All, I'm trying to fire a node script with forever @reboot and I'm having a hard time. Here's what I've tried. Note my script does in fact work and can be called with the following forever start /var/www/html/node_stuff/app.js but when I put it in the crontab it doesn't seem to fire @reboot fore...

Go to advanced search