I have a raspbery pi running cumulusmx and a python program on the same device posting my sensor data using the following code
Code: Select all
try:
x = requests.post( CMX_url , weather_data, timeout = 1.5)
y = x.text.find('success')
if y != 1 :
log_err("Ecowitt http output failed ############# : ")
except:
print("Failed")
where :
CMX_url = "http://localhost:8998/station/ecowitt"
weather_data={'dateutc' : EW_time , 'solarradiation' : LuxW, 'uv' : UV , ..... }
This works fine and if I copy the same code to my Windows box which also has CMX running and run it there it works fine.
Also if I change localhost to the appropriate 192.168.1.x it works fine on both boxes.
Both machines are on my local network with the same network mask.
What fails is if I run the code on the linux box but want to post to the WIndows box.
The command just times out no matter how long I make the timeout.
It doesn't evene execute the find command for "success" but drops straight to the except:
The command works fine from windows to linux!!
There are no obvious errors in the MXdiags file.
I can ping from linux to the windows box.
I have searched the internet but cannot find a solution or discover what I am missing so wonder if anyone has any bright ideas.
Edit: It must be a Linux network issue as http://192.168.1.2:8998 works on the window box but not in the browser of the linux box. However
on another tab in the linux browser I successfully get the CMX dashboard in if use the url http://192.168.1.15:8998