×
INDI Library v1.8.3 Released (02 Jan 2020)

Minor monthly bugfix release with a new RainbowAstro mount driver and improved pier side simulation.

Weather watcher question

3 weeks 10 hours ago
wimvb
Expert Boarder
Expert Boarder
Posts: 116
More
Topic Author
Weather watcher question #48745
Does the weather watcher driver need a file to read from?
I have a diy weather station based on a esp32 wifi board. The board acts as a webserver. When I configure this to create a index.html file, it gets read into the driver all right. The problem is that this is not a long term solution, as this file resides in the esp32 flash memory, which is not intended for frequent rewrites. My other option is to create a web page response "on the fly", when a request from a client is received. But when I test this with the weather watcher driver, it doesn't work. My question is, is the latter scenario supported by the driver? If so, what would I need to make it work?
The only other options I can think of are to either invest in a sd-card hat for the esp, or to have it write to a file on the sbc that holds indi/kstars. I don't know if that's even possible.
Any help would be appreciated.

Wim

Wim

Opticron Oregon 15*70, Skywatcher 150PDS + ST80, AZ-EQ6 GT + EQ3-2 Goto, ZWO ASI174MM-Cool + Pentax K20D (retired) + ZWO ASI120MM, homemade ditherbox, PixInsight, Rock64 x 2 with INDI & PHD2, cloud cover

www.astrobin.com/users/wimvb/

Please Log in or Create an account to join the conversation.

3 weeks 3 hours ago
fenriques
Expert Boarder
Expert Boarder
Posts: 145
More
Weather watcher question #48758
Hi Wim,
It should work when you set a web address as well.
Did you add the http:// at the beginning? Like
http://192.168.1.1:10800/cgi-bin/cgiLastData

Ferrante

Please Log in or Create an account to join the conversation.

3 weeks 2 hours ago
wimvb
Expert Boarder
Expert Boarder
Posts: 116
More
Topic Author
Weather watcher question #48761
Yes, I did. Made that mistake before, but not this time. There are also no subdirectories. The server code is generated by micropython code. I can see that the esp receives connections from indi, just that indi doesn't interprete what's coming back. If I connect with chrome, I get the response I should get:
temp=21.3
pressure=991
...

Wim

Opticron Oregon 15*70, Skywatcher 150PDS + ST80, AZ-EQ6 GT + EQ3-2 Goto, ZWO ASI174MM-Cool + Pentax K20D (retired) + ZWO ASI120MM, homemade ditherbox, PixInsight, Rock64 x 2 with INDI & PHD2, cloud cover

www.astrobin.com/users/wimvb/

Please Log in or Create an account to join the conversation.

3 weeks 2 hours ago
fenriques
Expert Boarder
Expert Boarder
Posts: 145
More
Weather watcher question #48762
can you please post here the source code of the output of the server?
and can you test this as weather data source?
kramers.mynetgear.com:10443/cgi-bin/cgiLastData

ferrante

Please Log in or Create an account to join the conversation.

2 weeks 6 days ago
wimvb
Expert Boarder
Expert Boarder
Posts: 116
More
Topic Author
Weather watcher question #48771
Your link works fine. I did some more tests. It seems that the WW driver reads the file as lines. My "web page" is output as one big chunk/line. This causes WW to only read the first keyword, which in my case was the time stamp. This time stamp isn't parsed by the driver. All subsequent text was just rejected. When I removed the timestamp and set temp= as the first piece of data, the driver reads this fine, but nothing after it.
Now I've recoded the webserver response and it works

Before:

conn, addr = s.accept()
print('Got a connection from %s' % str(addr))
request = conn.recv(1024)
conn.send('HTTP/1.1 200 OK\n')
conn.send('Content-Type: text/html\n')
conn.send('Connection: close\n\n')
conn.sendall(WebPage)
conn.close()

where 'WebPage' contained formatted html code with the data

Now:

conn, addr = s.accept()
print('Got a connection from %s' % str(addr))
request = conn.recv(1024)
conn.send('HTTP/1.1 200 OK\n')
conn.send('Content-Type: text/html\n')
conn.send('Connection: close\n\n')
conn.send('dataTime=' + strTimestamp +'\n')
conn.send('temp=' + bme_t +'\n')
conn.send('rain=0.00\n')
conn.send('pressure=' + bme_p +'\n')
conn.send('humidity=' + bme_h +'\n')
conn.send('dewpoint=' + bme_dp +'\n')
conn.send('clouds=' + ir_clouds +'\n')
conn.send('wind=1.50\n')
conn.close()

And this works fine. (Btw, don't have a rain and wind sensor installed yet)

Thanks for the help.

Wim

Wim

Opticron Oregon 15*70, Skywatcher 150PDS + ST80, AZ-EQ6 GT + EQ3-2 Goto, ZWO ASI174MM-Cool + Pentax K20D (retired) + ZWO ASI120MM, homemade ditherbox, PixInsight, Rock64 x 2 with INDI & PHD2, cloud cover

www.astrobin.com/users/wimvb/

Please Log in or Create an account to join the conversation.

2 weeks 6 days ago
fenriques
Expert Boarder
Expert Boarder
Posts: 145
More
Weather watcher question #48772
yes it is parsing the input line by line.
Good to hear that it works.
ferrante
The following user(s) said Thank You wimvb

Please Log in or Create an account to join the conversation.

1 week 2 days ago 1 week 2 days ago by plop3.
plop3
Fresh Boarder
Fresh Boarder
Posts: 9
More
Weather watcher question #49358
Hello,
I can't get Weather watcher to work.
The driver remains stuck on: <strong>"[INFO] Weather update is in progress ..."</strong>
And i have not the "Parameters" panel.
I tested with a script that returns:
dataGMTTime = 2020/02/11 11:42:25
temperature = 20
wind = 5
gust = 8
rain = 0
clouds = 0

With a file that contains its values,
with a "text / plain" and "text / html" website:
temperature = 20
wind = 5
gust = 8
rain = 0
clouds = 0

My script:

#!/bin/bash
GMT = $ (date + "% Y /% m /% d% H:% M:% S")
echo "dataGMTTime = $ GMT"
echo "temperature = 20"
echo "wind = 5"
echo "burst = 8"
echo "rain = 0"
echo "clouds = 0"


My website (ESP32):
String msg ="rain=0 <br>\ntemperature=0 <br>\nvent =0<br>\nrafale= 0<br>\nnuages=0 \ n";
   server.send (200, "text/html", msg);

or:
String msg = "rani=0\ntemperature=0 \nvent =0\nrafale=0<\ nnuages= 0\ n";
   server.send (200, "text/plain", msg);

I did a test with Watcher Proxy (and a json output), but there, the module crashes.

Please Log in or Create an account to join the conversation.

1 week 2 days ago
plop3
Fresh Boarder
Fresh Boarder
Posts: 9
More
Weather watcher question #49359
You can remove my post.
It's work with an Apache server...

Please Log in or Create an account to join the conversation.

1 week 2 days ago
plop3
Fresh Boarder
Fresh Boarder
Posts: 9
More
Weather watcher question #49360
I found my problem:
The Indi driver must be restarted after each configuration change.

Please Log in or Create an account to join the conversation.

Time to create page: 0.562 seconds