|
Post by festeraeb on Dec 15, 2021 12:11:16 GMT -8
I am new but I didnt see an answer in the forums. I have everything up and running, I am now connecting to weatherstem. However, I dont see it as a listed reporting station. Do they not include Skyweather2 stations? My main reason I care is I would like to mine the data. This station will be deployed remotely and I need to either be able to pull the data through weatherstem, or is there a way to set up a daily or hourly email of all the data collected from the devices. Basically a mysql pull? to get the data in .csv format? Open to ideas or suggestions. skyweather.weatherstem.com/johnsky1
|
|
|
Post by pagerman on Dec 16, 2021 6:27:02 GMT -8
I was wondering that as well. My station doesn't show up in the WeatherSTEM APP on my phone at all.
|
|
|
Post by festeraeb on Dec 16, 2021 6:30:51 GMT -8
If that is the case how are others mining data who arent on the same network? I can think of a lot of different ways. Has anyone used an FTP client to upload to google drive?
|
|
|
Post by festeraeb on Dec 16, 2021 15:10:18 GMT -8
|
|
|
Post by festeraeb on Dec 16, 2021 19:02:12 GMT -8
If anyone wants to look this over. I would appreciate feedback. I think if I wrote it correctly this will allow me to back up my sql data. Using rclone and crontab. I am very new to python. I am trying to get a push of sensor data I can keep in a database and my weather station won't have a static IP address.
#re-create a backup directory rm -rf /backup mkdir /backup
#create a database's dump mysqldump --all-databases > /backup/mysql.sql
#send to the cloud rclone copyto /mysql.sql my-gdrive:/backup-for-article/MySQL.sql
#delete old backups sudo rclone delete my-gdrive:/backup-for-article/ --min-age 7d
#delete the temporary directory rm -rf /backup
#schedule every 5 minutes sudo crontab -e
*/5 * * * bash /home/user/scripts/backup-all.sh
|
|
|
Post by Jason on Dec 17, 2021 2:30:19 GMT -8
All of my stuff is distributed using MQTT which is built into the SkyWeather2 code base already. Below is the current architecture of my stuff that includes three RPis and one always-free ARM compute instance in Oracle Cloud. Thanks, Jason
|
|
|
Post by festeraeb on Dec 17, 2021 9:20:34 GMT -8
All of my stuff is distributed using MQTT which is built into the SkyWeather2 code base already. Below is the current architecture of my stuff that includes three RPis and one always-free ARM compute instance in Oracle Cloud. Thanks, Jason <button disabled="" class="c-attachment-insert--linked o-btn--sm">Attachment Deleted</button> Thanks, I am also trying to figure out MQTT and Node Red. My thought is doing similar to what I wanted above but use the sensor data via mqtt to node red and use that to publish to google forms/sheets. Saves me from needing a cloud service. Any tutorial or code for getting the data via MQTT to node red would be appreciated. I understand how to use node red to google forms.
|
|
|
Post by Jason on Dec 17, 2021 9:49:06 GMT -8
You need to run an MQTT broker. SkyWeather2 sends the telemetry to topics on the broker and NodeRED subscribes to topics on the broker and processes the data based on the workflows you build. I would recommend Mosquito but any MQTT broker will work just fine since MQTT is a protocol. Running one on a RPi within your local network is as simple as running sudo apt install mosquitto. No need for advance configuration unless you are running outside your private network.
Thanks,
Jason
|
|
|
Post by festeraeb on Dec 20, 2021 5:57:42 GMT -8
Thanks, I am getting there with it I think.
|
|
|
Post by festeraeb on Dec 21, 2021 9:35:58 GMT -8
ok i will admit I am lost. in skyweather2.py set up MQTT if (config.MQTT_Enable): state.mqtt_client = mqtt.Client(client_id="SkyWeather2") state.mqtt_client.connect(config.MQTT_Server_URL, port=config.MQTT_Port_Number)
import publishMQTT
This launches an mqtt client called SkyWeather2 correct? and it imports publishMQTT.py correct? So we need to configure publishMQTT
import config import state
import paho.mqtt.client
def publish():
if (config.SWDEBUG): print("--->Sending MQTT Packet<---") state.mqtt_client.publish("skyweather2/state", state.StateJSON)
From the Skyweather2 Json file "MQTT_Enable": true, "MQTT_Server_URL": "localhost", "MQTT_Port_Number": "1883", "MQTT_Send_Seconds": "500"
From the state.py file mqtt_client = None (Does this need to be localhost?)
|
|
|
Post by festeraeb on Dec 21, 2021 9:54:53 GMT -8
Then in Node red I should do a Mqttin and point it to skyweather2/state? then if i load a debug I should see the output under that node right?
|
|
|
Post by Jason on Dec 21, 2021 11:26:40 GMT -8
Yup that's correct! SkyWeather2 publishes data to the topic on the broker. NodeRED subscribes to the topic on the broker and listens for data.
Thanks,
Jason
|
|
|
Post by festeraeb on Dec 21, 2021 12:30:26 GMT -8
Well I have it updating to google forms but it only seems to be sending the timestamp. I will have to figure out what I have wrong but atleast now it is communicating
|
|
|
Post by festeraeb on Dec 21, 2021 12:55:05 GMT -8
I set up google forms with 1 question and thought I could send all the data to the one question with the answer set up for short answer and it would push everything created in skyweather2.state but it appears to only record the date and time. If anyone has done this I am open to ideas. Do I have to parse the individual readings out somehow and send them with different form id numbers?
|
|
|
Post by festeraeb on Dec 21, 2021 14:14:02 GMT -8
This is where I am at now.
|
|