The last few weeks I have been working on a weewx driver for Davis Weather 
Link Live. This device can give regular intervals of full ISS data and a 
2.5 seconds interval of UDP data containing wind and rain. See this site 
for more information 
https://weatherlink.github.io/weatherlink-live-local-api/

At this moment there is a working beta version: 
https://github.com/grebleem/WeatherLinkliveUDP for who is interested. The 
driver can be seen in action here https://meteo-otterlo.nl 

However, the JSON data can be a bit odd when using multiple stations. That 
is if a second ISS for an anemometer or a separate temperature sensor is 
installed. 

So if you have a Davis Weather Link Live (WLL), it would helpful if you 
post the JSON response from a http://1.2.3.4:80/v1/current_conditions 
request in a web browser (where 1.2.3.4 is the ip address of the WLL). So I 
can implement multiple sensors in this driver. 

Also at the davis-udp.py program will write the UDP JSON to a file, these 
also would be very helpful!

Thanks,
Bastiaan

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/18937d15-d8ee-4699-943b-ede791eda6c7o%40googlegroups.com.
from socket import *
import struct
import time
import requests
import json

# WLL ip address
URL = 'http://192.168.1.47:80/v1/real_time?duration=20'


def main():
    global URL
    UDP_PORT = 22222
    comsocket = socket(AF_INET, SOCK_DGRAM)
    comsocket.bind(('', 22222))
    comsocket.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
    resp = requests.get(URL)
    i = 0
    BigJson = {}

    while 1:
        while i < 6:
            ## print("HTTP Response Code:", resp)
            data, wherefrom = comsocket.recvfrom(2048)
            json_data = json.loads(data.decode("utf-8"))
            if json_data["conditions"] == None:
                print(json_data["error"])
            else:
                BigJson[i] = json_data
                ## print(json.dumps(json_data))
                i = i + 1
        print(f'test{round(time.time())}.json is created.')
        with open(f'test{round(time.time())}.json', 'w') as outfile:
            json.dump(BigJson, outfile)
        i = 0
    comsocket.close()


if __name__ == "__main__":
    main()

Reply via email to