Go to advanced search

by loes7815
Tue Nov 15, 2016 11:14 am
Forum: Off topic discussion
Topic: ESP8266 flashing
Replies: 6
Views: 2353

Re: ESP8266 flashing

Yes I think so, I have connected them as follows; http://i64.tinypic.com/dhcpza.png http://i67.tinypic.com/20usab6.jpg And I dont know, where to look for the firmware. Where should i find it? The IDE window when everything is connected ( and GPIO0 disconnected from ground) http://i68.tinypic.com/24e...
by loes7815
Tue Nov 15, 2016 10:56 am
Forum: Off topic discussion
Topic: ESP8266 flashing
Replies: 6
Views: 2353

ESP8266 flashing

Hi, I having problems with flashing my ESP8266. I'm following this tutorial; https://www.youtube.com/watch?v=Gh_pgqjfeQc Although I have a slightly different FTDI (basic). the nodemcu flashware doesnt start flashing, it keeps at 'begin find ESP8266' I already bought more ESP chips, because I thought...
by loes7815
Wed Jun 08, 2016 11:56 am
Forum: Off topic discussion
Topic: ESP-01 NodeMCU firmware flashing
Replies: 2
Views: 1325

ESP-01 NodeMCU firmware flashing

Hi! Maybe a simple problem, but I can't get it to work properly. I got a ESP-01 module with a FTDI, I hooked it up to my pc to flash the NodeMCU firmware on the ESP. But I got the same problem as the guy in this tutorial: https://www.youtube.com/watch?v=Gh_pgqjfeQc The NodeMCU firmware programmer is...
by loes7815
Fri May 27, 2016 11:29 am
Forum: Other programming languages
Topic: mySQL data to javascript [with PHP]
Replies: 6
Views: 1009

Re: mySQL data to javascript [with PHP]

I find what you are trying to do there totally abhorrent. In one short file you are mixing five different language syntaxes! HTML, php, sql, javascript and JSON. A little bit of CSS would have rounded it of nicely :) I learned from having to work on this kind of web language soup back the late 1990...
by loes7815
Fri May 27, 2016 10:06 am
Forum: Other programming languages
Topic: mySQL data to javascript [with PHP]
Replies: 6
Views: 1009

Re: mySQL data to javascript [with PHP]

I'm sorry, you're right. I commented out a part of the code because I wanted to use it later on. I deleted the commented part in my openings post (to make it more clear), but deleted the wrong var temp. I edited the openings post. Does not change my problem, It still does not work. I'm getting a bla...
by loes7815
Fri May 27, 2016 9:30 am
Forum: Troubleshooting
Topic: Running a code after every 10 minutes
Replies: 7
Views: 1133

Re: Running a code after every 10 minutes

I get the following error: File "temperature_database_mysql.py", line 54 if datetime.datetime.now() >= ts_now ^ SyntaxError: invalid syntax You forgot the colon at the end of that line: if datetime.datetime.now() >= ts_now: Thank you!! I think it works, have to test it multiple times to see the dif...
by loes7815
Fri May 27, 2016 9:09 am
Forum: Other programming languages
Topic: mySQL data to javascript [with PHP]
Replies: 6
Views: 1009

mySQL data to javascript [with PHP]

Hi! I have a question about how I can pass data from a mySQL database to javascript. I already made an example with a static array, see below; <html> <head> <title> My first PHP Page </title> </head> <body> <p id="demo"></p> <p> -------- </p> <p id="demo2"></p> <?php $book = array(1,2,3); $temp = ar...
by loes7815
Fri May 27, 2016 8:37 am
Forum: Troubleshooting
Topic: Running a code after every 10 minutes
Replies: 7
Views: 1133

Re: Running a code after every 10 minutes

You can record the time when you post a result then add 10 minutes to that to set a target time for the next data point. You can then poll the current time in a loop with a sleep() until the current time >= target time, then post a new reading. If you want every data point to be a multiple of 10 mi...
by loes7815
Fri May 27, 2016 8:00 am
Forum: Troubleshooting
Topic: Running a code after every 10 minutes
Replies: 7
Views: 1133

Running a code after every 10 minutes

Hi! I got a piece of code where I insert data from my sensors into a mySQL database. At this moment I run the code with a sleeping time at the end, but running the code takes some time as well and after a week the realtime is not the same as the timestamps corresponding with the datapoints. How can ...
by loes7815
Wed May 04, 2016 2:11 pm
Forum: Troubleshooting
Topic: ESP-01 picocom can't find file
Replies: 9
Views: 1601

Re: ESP-01 picocom can't find file

It is working :)

Found another tutorial with

Code: Select all

sudo picocom /dev/ttyAMA0 --b 115200 --omap crcrlf --imap crcrlf
This one is working.
Thank you!
by loes7815
Wed May 04, 2016 1:55 pm
Forum: Troubleshooting
Topic: ESP-01 picocom can't find file
Replies: 9
Views: 1601

Re: ESP-01 picocom can't find file

What model Pi do you have? On a Pi3B you probably have to use /dev/ttyS0 (also with a zero at the end) The omap parameter is correct (and necessary). It makes sure a carriage return + linefeed is sent when you press <ENTER> I have a 2B. I don't no why the output changed, but I just entered: picocom...
by loes7815
Wed May 04, 2016 1:39 pm
Forum: Troubleshooting
Topic: ESP-01 picocom can't find file
Replies: 9
Views: 1601

Re: ESP-01 picocom can't find file

DirkS wrote:Your device name is wrong. The correct name has a 0 (zero) at the end, not an O (uppercase o)

Code: Select all

picocom /dev/ttyAMA0 -omap crcrlf
(BTW: On current Jessie images you shouldn't have to use sudo)
Does not make any changes to the outcome.
I also tried -emap instead of -omap, no changes either.
by loes7815
Wed May 04, 2016 12:28 pm
Forum: Troubleshooting
Topic: ESP-01 picocom can't find file
Replies: 9
Views: 1601

ESP-01 picocom can't find file

Hi! I try to connect my ESP-01 module to my raspberry. I have followed this instruction. But when I enter sudo picocom /dev/ttyAMAO -omap crcrlf it returns Unrecognized option. Run with --help When I run sudo picocom /dev/ttyAMAO It returns picocom v1.7 port is : /dev/ttyAMAO flowcontrol : none baud...
by loes7815
Fri Apr 29, 2016 1:56 pm
Forum: Troubleshooting
Topic: push buttons interrupts
Replies: 9
Views: 4279

Re: push buttons interrupts

However, python is now printing like 1000 times the same value with the same time stamp in the csv file every 60 seconds. Do you also get repeated print messages from the callback function (like 'button is 1')? When I push a button I get: button is 1 [1] Button is 2 [2,1] etc. So it seems to go rig...
by loes7815
Fri Apr 29, 2016 1:18 pm
Forum: Troubleshooting
Topic: push buttons interrupts
Replies: 9
Views: 4279

Re: push buttons interrupts

Attaching a push-button to an interrupt is not a good idea; because of contact bounce it can trigger hundreds (or thousands) of interrupt signals... also, the interrupt mechanism needs to know rising edge or falling edge and it can't keep that straight with contact bounce. You can use bounce condit...
by loes7815
Fri Apr 29, 2016 1:03 pm
Forum: Troubleshooting
Topic: push buttons interrupts
Replies: 9
Views: 4279

push buttons interrupts

Hi! My previous problem is solved, but I got another issue. I would like to use pushbuttons to write a number in a file, like button 1 is 1, button 2 is 2 etc. I've used interrupts to do this, and it works. However, python is now printing like 1000 times the same value with the same time stamp in th...
by loes7815
Fri Apr 29, 2016 12:42 pm
Forum: Troubleshooting
Topic: Putting data in SQL database
Replies: 12
Views: 2244

Re: Putting data in SQL database

Found it!
Thank you very much.
I rebooted and the problem was fixed.
I use the SQLite data browser, and I think I didn't close the file correctly.
by loes7815
Fri Apr 29, 2016 11:41 am
Forum: Troubleshooting
Topic: Putting data in SQL database
Replies: 12
Views: 2244

Re: Putting data in SQL database

Is there a pending commit? This the whole code: import csv, os, glob, time, datetime import RPi.GPIO as GPIO import sqlite3 GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) time_start = datetime.datetime(2016,4,29,11,30) id_time = 0 time_now = time_start step = datetime.timedelta(minutes = 10) CO2WK ...
by loes7815
Fri Apr 29, 2016 9:58 am
Forum: Troubleshooting
Topic: Putting data in SQL database
Replies: 12
Views: 2244

Putting data in SQL database

Hi! I want to put multiple sensor data in a sqlite database. At this moment I only have my temperature sensor to check if everything is working, but it isn't. My command window shows an error, when running the code: sqlite3.OperationalError: database is locked What could be the problem? Small piece ...
by loes7815
Fri Apr 22, 2016 2:45 pm
Forum: Troubleshooting
Topic: constant checking input, writing every minute
Replies: 12
Views: 1196

Re: constant checking input, writing every minute

I edited the code in the previous post.

I want to write a value to the file every 10 seconds, even when no buttons are pushed (the same value as in the previous 10 seconds should be written down).
Thats why I added the else statement.

In which branch do you mean? And why/how am I killing my pi?
by loes7815
Fri Apr 22, 2016 2:33 pm
Forum: Troubleshooting
Topic: constant checking input, writing every minute
Replies: 12
Views: 1196

Re: constant checking input, writing every minute

Last question for today haha. I think I'm almost there. It's working at least, but now python is printing like 1000 times the same value with the same time stamp in the csv file every 10 seconds. Where is this coming from? import RPi.GPIO as GPIO from time import gmtime, strftime import csv, os, glo...
by loes7815
Fri Apr 22, 2016 1:20 pm
Forum: Troubleshooting
Topic: constant checking input, writing every minute
Replies: 12
Views: 1196

Re: constant checking input, writing every minute

thank you!
if I put the if statement at the same level as the try statement, it will only calculate elapsed ones. right?
Because it will not write anything to the csv file.
by loes7815
Fri Apr 22, 2016 1:06 pm
Forum: Troubleshooting
Topic: constant checking input, writing every minute
Replies: 12
Views: 1196

Re: constant checking input, writing every minute

ok, I'm a bit further, but I still strugle with averaging and writing the data to a file. I can't figure out what is going wrong. import csv, os, glob, time, datetime GPIO.setmode(GPIO.BCM) start = strftime("%S", gmtime()) start = int(start) print start GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_...
by loes7815
Fri Apr 22, 2016 10:12 am
Forum: Troubleshooting
Topic: constant checking input, writing every minute
Replies: 12
Views: 1196

Re: constant checking input, writing every minute

Thank you, I think I was searching for the interrupt function.
I look into it!
by loes7815
Fri Apr 22, 2016 9:48 am
Forum: Troubleshooting
Topic: constant checking input, writing every minute
Replies: 12
Views: 1196

Re: constant checking input, writing every minute

haha I got a piece of code, but it doesnt write down de average over time: import csv, os, glob, time, datetime import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: input_state = GPIO.input(18) if input_state == False: button1 = 1 with open("bu...

Go to advanced search