-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V21Final serial monitor check #1
Comments
Now, the last one (DebugVersion_21_Final) uses the extra on-board sensors etc. You will have to comment out code that refers to them. Around 15 lines of code. (I am guessing here) Start at the top and then remove what gives errors. Their final values will be returned as zeroes. Once you have it working you can then cut/build it how you want. Sounds like you are on your way. |
Rob i remove all DHT and BMP line, does on line 536 i have to keep 7? Once again, if i run serial monitor, does I have a chance to see something written ? (for the moment when i run serial monitor, nothing is shown, and i think your skecth stop (led on pin 13 stop blinking). I'm sure i need a python script to recieve the data and write the csv file, maybe you can share yours, or something similar, just for me to have a chance to check if my correction (simplification) are good. |
Hi Deennoo, If you also comment out 536 and 561 then it will stop the program insisting on all sensors having reported in before sending out a csv line of characters. It will send out a line of csv every minute. Any sensors that have not yet been read, will simply return a zero until a valid reading updates the variable. It will retain that value until a valid reading of the sensor is eventually made. I am away from my main computer at the moment and won't be able to organise some Python code for you just yet. However I was wondering if you would like to save the csv data to an SD card connected on the Arduino, this way no Python would be needed to store the CSV data. However to process to graphs etc Python is very handy. I could help you get an SD card attached if you are interested in doing that? Cheers, Rob |
when i'll be sure that i can run your skecth without internal sensor, i'll plug your arduino reciever module to my raspberry, try to made a script to get data on csv, With this data i'll update my weatherunderground PWS and my homeautomation software (raspberry app call Domoticz http://www.domoticz.com/). |
ok I try, you tips and looks to works : Led blinking, but still nothing on serial monitor. Is this normal ? |
Hi Deennoo, |
Dear Rob, i finaly got some value (i don't eat this lunch but i got the value ! show like this : 0,0,7,4.7,62.1,8.00 where i guess : is there a way to get external humidity ? and channel ? i got 2 thgr800 sensor, 1 on ch1 and 1 on ch2 (ch2 is a fake on to get my swimming pool temp, sketch use is good because my wmr86 recieve the fake sensor and read it). |
Congratulations Deennoo... Yes that is correct, the byte0 and byte1 are my experimental values I was sending from a sensor set up I had designed myself. You can either get rid of them or reuse them yourself your own way. Plus you can now add in your own choices of values, for example I don't use 'rain rate' or 'average wind speed' but you might like to print those out. I also use the digital humidity sensor on the board rather than the one from the Oregon Temp/Hum sensor. Now that you have got this far many things will have opened for you. I only have one Temp/Humidity sensor so I don't decode the switch inside it to be able distinguish it from a second sensor. However I have tested the switch on mine and I know how to determine one THGR800 from another. Have a look at lines 486-505. nybble5 contains the value of the sensor's switch. So the code could be something like this: double temperature1 = 0;
int humidity1 = 0;
double temperature2 = 0;
int humidity2 = 0; Then around the lines 495-505 make some changes like this void thermom(){
temperature = (double)((nyb(11)*100)+(nyb(10)*10)+nyb(9))/10; //accuracy to 0.01 degree seems unlikely
if(nyb(12)==1){// Trigger a negative temperature
temperature = -1.0*temperature;
}
humidity = (nyb(14)*10)+nyb(13);
if (nyb(5)==1){
temperature1=temperature;
humidity1 = humidity;
}
if (nyb(5)==2){
temperature2=temperature;
humidity2 = humidity;
}
} etc Probably not the most elegant solution, but should work. I hope this is all helping. Cheers, Rob |
Hi Deennoo, |
Just working on the channel. on debugversion_16_nextstep more easy to introduce : line : 49 : int channel = 0; next step ? add this to version 21final |
Hi Deennoo, |
ok Done !! only channel 1 is shown and i have add humidity on your csv ready to export. i make a froke and submit a new version |
Hi Deennoo, |
Switch already change, channel détection ok |
Ahh back at home, no more viewing on a Phone!! |
Cool ! My python script is OK i record arduino serial output to a .csv file. Juste tome stamp is missing, if you got an idéal how to add it on arduino sketch i'm happy |
Here is my Python script that I have been experimenting with. It dumps to a couple of .json format files but also includes a time stamp. import time #I think this is the main one...
import calendar
from time import strftime, gmtime, localtime And the code: #dump time,pressure,temperature, wind speed, wind direction to App format for Nick
#In a file named 'weather.json'
#{"temperature":25,"pressure":1000,"wind_speed":8,"wind_direction":W}
app = open("//var/www/LTB/ramdrive/weather.json","w")
app.write("{\"time_EPOCH\":"+str(time.time())+",\"temperature\":"+str(mytemperature[719])+",\"pressure\":"+str(mypressure[719])+",\"wind_speed\":"+str(mywindspeed[719])+",\"wind_direction\":"+str(mywinddirection[719])+",\"humidity\":"+str(myhumidity[719])+"}\n")
app.close()
app = open("//var/www/LTB/ramdrive/experimental.json","w")
app.write("{\"time_EPOCH\":"+str(time.time())+",\"Byte0\":"+str(wlist[0])+",\"Byte1\":"+str(wlist[1])+"}\n")
app.write("{\"time_EPOCH\":"+str(time.time())+",\"TempSamp\":"+str(float((int(wlist[0])*256)+int(wlist[1]))/16)+"}\n")
app.close() You can probably format that to however you want knowing the versatility of Python. |
ok thank you very complicated for my who is a python newbie... i have to learn how to import your code on my python script who is like this : #!/usr/bin/python get lines of text from serial port, save them to a filefrom future import print_function addr = '/dev/ttyUSB23' # serial port to read data from with serial.Serial(addr,115200) as pt, open(fname,fmode) as outf: |
That seems to be similar to the I the way I did it Deennoo import socket
import os
........
#Now swapping to the serial input
ser = serial.Serial('/dev/ttyACM0', 115200) #sets up Python Serial but also restarts Arduino
print "Attached Serial Port @ ttyACM0, 115200 baud"
....
while True:
#new version using the serial port
ser.flushInput() #for a nice clean start
# ii, pp, Quad, Speed, Rain, ExTemp, InTemp, Press,Humi @115200
print ("Awaiting data.....")
dataRaw = ser.readline()
#example data Cycles -1.0 = 3,2,14,5.1,3504,7.00,12.00,1017.80,60.00(nl)(re)
data = dataRaw.strip(' \t\n\r') #remove /n and /r off the end of the incoming serial string
wlist = logspliter.split(data) #Split by comma into a list, wdict[]
print(wlist) So I would guess you are on the right track. writer = open("//var/www/LTB/ramdrive/dump.csv","w")
writer.write("H:M,Pressure,Temperature,Wind Speed,Wind Direction,Rainfall,Humidity\n")
h=0
m=1
for i in range(719,0,-1):#how to count backwards
writer.write(str(h)+":"+str(m)+","+str(mypressure[i])+","+str(mytemperature[i])+","+str(mywindspeed[i])+","+str(mywinddirection[i])+","+str(myrain[i])+","+str(myhumidity[i])+"\n")
m=m+1
if m==60: #increment hours every 60 minutes
h=h+1
m=0
writer.close() I use it to debug reading etc with a spreadsheet. Otherwise it writes it but I do not use it. I keep 720 1 minute readings in the computer to graph at any one time, this just dumps them out. |
How's it going Deennoo?? Rob Ward On 17/01/15 19:44, deennoo wrote:
|
I don't manage to get succès with python And weather underground update.Some project are more easyer for me...Envoyé depuis mon mobile Huawei-------- Message original --------Objet : Re: [Weather-Station-OS-Sensors] V21Final serial monitor check (#1)De : Rob Ward À : robwlakes/Weather-Station-OS-Sensors Cc : deennoo How's it going Deennoo?? Rob Ward On 17/01/15 19:44, deennoo wrote:
—Reply to this email directly or view it on GitHub. |
No Problems, best wishes with your new projects ;-) Rob Ward On 02/02/15 22:51, deennoo wrote:
|
Hi Rob !
v16_next step give me good result on serial monitor
Did version_v21final have to give result on the serial monitor ?
The text was updated successfully, but these errors were encountered: