Go to advanced search

by richiepp
Mon Jun 06, 2016 11:39 am
Forum: Other programming languages
Topic: Node.js to display serialport data on webpage
Replies: 1
Views: 1164

Node.js to display serialport data on webpage

I have an Arduino with a temperature sensor hooked up that sends serial messages with the current reading every few seconds. I want to use Node.js to read those serial signals and render them in real time to a webpage. I have a simple node script that reads the serial port. and returns what it sees....
by richiepp
Sat Jun 04, 2016 6:28 pm
Forum: Python
Topic: Listen for serial signals from Arduino
Replies: 3
Views: 2053

Re: Listen for serial signals from Arduino

I was able to get around the reset issue by using Serial1 on the Mega. I'm able to open and close it without resetting ;)

I'll check out Johnny Five
Thanks
Rich
by richiepp
Sat Jun 04, 2016 4:43 pm
Forum: Python
Topic: Listen for serial signals from Arduino
Replies: 3
Views: 2053

Listen for serial signals from Arduino

Hey All, I'm working on a home automation project that uses a RPI3 and an Arduino Mega. Most of the pins on the Pi will be used up by a TFT touchscreen monitor. So I'm trying to do all of the IO through the Arduino and communicate back and forth over serial with the Pi. I have an IR receiver that in...
by richiepp
Fri Jun 03, 2016 3:20 pm
Forum: Other programming languages
Topic: AJAX Button change css class
Replies: 0
Views: 763

AJAX Button change css class

Hey All, I've got an AJAX button that calls a python script that toggles a pin on an Arduino Mega. The script reads and writes a 1 or 0 to a text file called led_status. If the script reads 1 it changes it to 0 and turns the pin low and vice versa. My task at hand is to change the css of the button ...
by richiepp
Fri Jun 03, 2016 2:12 pm
Forum: Python
Topic: read and or write to a txt file with python
Replies: 5
Views: 3840

Re: read and or write to a txt file with python

Thanks PCManBob, that did it! But I did need to add the port.write() lines to make it toggle the pin. The completed code is below. On to my next question. I'm going to be sending signals like this to 15 or more pins on an Arduino Mega. I'll be using AJAX calls to trigger the scripts. Should I create...
by richiepp
Fri Jun 03, 2016 10:08 am
Forum: Python
Topic: read and or write to a txt file with python
Replies: 5
Views: 3840

Re: read and or write to a txt file with python

Thanks for the tutorials. So to pull this off I'll need an if else statement. I've tried that below but I can't seem to get it to work properly. !/usr/bin/python import serial import cgitb cgitb.enable() port = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=3.0) current_status = open('led_stat...
by richiepp
Thu Jun 02, 2016 10:07 pm
Forum: Python
Topic: read and or write to a txt file with python
Replies: 5
Views: 3840

read and or write to a txt file with python

Hi, I have two simple python scripts to send serial signals to an Arduino to toggle pins high (H) and low (L). I'm writing to a text file the status of the pin H or L. I want to combine the two scripts to read the text tile first and then toggle the pin to the opposite state. Below is my code to tur...
by richiepp
Thu Jun 02, 2016 3:51 pm
Forum: Python
Topic: Arduino RPI Serial Python turns the pin low after executing
Replies: 3
Views: 1027

Re: Arduino RPI Serial Python turns the pin low after execut

Update I was able to get around this by using the Serial1 port on the Mega; no more resetting. I'm using this FTDI cable to make the connection https://www.sparkfun.com/products/9717 Here's what the Arduino sketch looks like. const int ledPin = 12; // the pin that the LED is attached to int incoming...
by richiepp
Thu Jun 02, 2016 2:58 pm
Forum: General programming discussion
Topic: Websocket to display temperature readings from Arduino
Replies: 1
Views: 1436

Websocket to display temperature readings from Arduino

Hey All, I'm working on a home automation project where my RPI 3 is the brains and an Arduino Mega is the brawn. I'm communicating between them via serial. I have temperature sensors on the Arduino and would like to display the readings dynamically via a webpage. What's the best way to do this? I've...
by richiepp
Tue May 24, 2016 3:06 pm
Forum: Other programming languages
Topic: Call a python script from a javascript button
Replies: 10
Views: 10863

Re: Call a python script from a javascript button

Thanks for your example Heater, it's definitely along the lines of what I'm working towards. I appreciate the well formatted code. Hats off for styling the buttons with CSS. Nice work! That being said I'm getting a 404 error on line 1456 of socket.io.js that line looks like this xhr.send(this.data);...
by richiepp
Mon May 23, 2016 4:14 pm
Forum: Other programming languages
Topic: Call a python script from a javascript button
Replies: 10
Views: 10863

Re: Call a python script from a javascript button

Thanks Heater I'll check it out! I guess this brings me to the broader question of what kind of web server should I be running? Like a lot of us I have years of experience with Apache LAMP servers. Do I set that aside and learn node.js? Or perhaps run a hybrid server using them both? I just found th...
by richiepp
Mon May 23, 2016 3:37 pm
Forum: Other programming languages
Topic: Call a python script from a javascript button
Replies: 10
Views: 10863

Re: Call a python script from a javascript button

Hmmm, yeah I did a version of this a few years ago where I used php but it always seemed klunky to me. And yeah I'm looking for a method to do asynchronous HTTPrequest. This task seems, to me anyway, to be on the level of a hello world or blink sketch kind of thing. With so many of us developing hom...
by richiepp
Mon May 23, 2016 2:42 pm
Forum: Other programming languages
Topic: Call a python script from a javascript button
Replies: 10
Views: 10863

Call a python script from a javascript button

Hey All, I'm working on a home automation project involving a RPI 3 and an Arduino Mega. Most of the pins on the Pi will be used up by a TFT screen from Adafruit; once they get it in stock again. https://www.adafruit.com/products/2453 My plan is to do all of the IO through the Arduino and communicat...
by richiepp
Thu May 19, 2016 11:48 am
Forum: Other programming languages
Topic: Apache cgi-bin config
Replies: 7
Views: 9323

Re: Apache cgi-bin config

Thanks Knute! that was it!
by richiepp
Wed May 18, 2016 12:21 pm
Forum: Other programming languages
Topic: Apache cgi-bin config
Replies: 7
Views: 9323

Re: Apache cgi-bin config

ok, that got me a little closer. Now I'm getting a different error message. This time from the Apache2 log 10.0.0.9 - - [18/May/2016:07:20:17 -0500] "GET /cgi-bin/on.py HTTP/1.1" 500 803 "http://10.0.0.12/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661...
by richiepp
Tue May 17, 2016 3:39 pm
Forum: Other programming languages
Topic: Apache cgi-bin config
Replies: 7
Views: 9323

Re: Apache cgi-bin config

Hmmm, I ran sudo a2enconf serve-cgi-bin and it said it was already running. I currently have /var/www/html owned by www-data. I also have /usr/lib/cgi-bin owned by www-data. Rght now when I call the foo.cgi you suggest above I get the following Apache error You don't have permission to access /cgi-b...
by richiepp
Mon May 16, 2016 11:47 am
Forum: Other programming languages
Topic: Apache cgi-bin config
Replies: 7
Views: 9323

Re: Apache cgi-bin config

I'm still looking for an answer to this. Does anyone know how to get cgi scripts running from Apache?

Thanks
Rich
by richiepp
Sun May 15, 2016 1:55 pm
Forum: Other programming languages
Topic: Apache cgi-bin config
Replies: 7
Views: 9323

Apache cgi-bin config

Hey All, So I've got my LAMP server up and running, it was relatively easy as there are many tutorials on the web. But things become difficult when it comes to properly configuring cgi-bin. I want to use .sh .cgi and .py files. If anyone knows of a good tutorial please pass it along. My understandin...
by richiepp
Wed May 11, 2016 1:50 pm
Forum: Other programming languages
Topic: Apache2 PHP config woes
Replies: 1
Views: 481

Apache2 PHP config woes

So I'm working on setting up a LAMP server on the pi and I'm currently trying to get php working properly. I had it up and running earlier today but I broke something along the way. I suspect it has something to do with the owner of the files. Here is a screen shot of the files in the Apache2 root /...
by richiepp
Mon May 09, 2016 9:28 pm
Forum: Python
Topic: Ack! Trouble getting python scripts to execute on Apache2
Replies: 0
Views: 302

Ack! Trouble getting python scripts to execute on Apache2

Hey All, So I've done this on other Pi's before but I can't seem to get this one going. I have a Pi setup running Apache and I'm trying to get python scripts running from the cgi-bin. I made the files executable and did chmod on the cgi-bin directory and the files inside. I suspect the problem lies ...
by richiepp
Thu May 05, 2016 1:27 pm
Forum: Python
Topic: Arduino RPI Serial Python turns the pin low after executing
Replies: 3
Views: 1027

Re: Arduino RPI Serial Python turns the pin low after execut

Yeah it must be an Arduino issue because when you open and close the serial monitor in the Arduino IDE it resets the board each time. Hmm, this might be tough to fix.
by richiepp
Thu May 05, 2016 1:17 pm
Forum: Python
Topic: Arduino RPI Serial Python turns the pin low after executing
Replies: 3
Views: 1027

Arduino RPI Serial Python turns the pin low after executing

I'm setting up my Pi to use serial with an Arduino Mega. I'd like to use simple python scripts to toggle pins on the Arduino. I'm getting started with a simple python blink script which works as expected until the end when the serial port closes. Note that I've also tried to leave the port open but ...
by richiepp
Wed May 04, 2016 1:04 pm
Forum: Troubleshooting
Topic: Using iPhone to send bluetooth serial to RPI
Replies: 2
Views: 1526

Using iPhone to send bluetooth serial to RPI

So I've got my Pi paired up with my iphone but I can't find a working app that lets me send serial signals. I've tried a handful of free bluetooth apps for the phone but none of them can see the PI. Note that the Pi is defintely connected, I've verified it from both sides; the Pi and the iPhone. But...
by richiepp
Mon May 26, 2014 6:43 pm
Forum: Automation, sensing and robotics
Topic: dht-11 temperature sensor problems
Replies: 2
Views: 1756

Re: dht-11 temperature sensor problems

I tried to get the DHT-11 with the Pi about a year ago, failed and moved on. I can get it to work easily on an Arduino but no luck with the Pi. Would love to know if this is possible.

Good Luck!

Rich
by richiepp
Tue Apr 29, 2014 2:40 pm
Forum: Troubleshooting
Topic: SD Card Fail?
Replies: 10
Views: 1844

Re: SD Card Fail?

I think I'm experiencing SD card issues as well, I won't go into details. But my next line of attack is to setup the Pi to run primarily from a USB stick. Presumably this will increase performance and stability. I'm just waiting for a rainy day and some time to kill to set it up. http://www.dinglebe...

Go to advanced search