1

I'm trying to run weather data through motion/motioneye, and I've ran into a problem that I cannot for the life of me figure out.

I do this - and it works, embedding the text into the image / timelapse

$ curl http://192.168.0.168:7999/1/config/set?text_left="TESTING_PLEASE_STANDBY" text_left = TESTING_PLEASE_STANDBY Done

However my weather data is tagged out into a file - the inside looks like this: Temp: <#temp>°C - Press: <#press> hPa - Hum: <#hum>% - Wind: <#wspeed> mph(<#currentwdir>) - Rain: <#rfall> mm - UV Index: <#UV> - SolarRad: <#SolarRad> W/m² - CloudBase: <#cloudbase>, which when processed is a text file that looks like this: Temp: 7.2°C - Press: 973.9 hPa - Hum: 88% - Wind: 5 mph(SW) - Rain: 2.3 mm - UV Index: 0.0 - SolarRad: 0 W/m² - CloudBase: 759 ft

It's just really a test at the moment but I just can't get motion to accept it regardless of how I try and there seems to be a lot of options as to how it can be done

curl --data "@Camdata.txt" http://192.168.0.168:7999/1/config/set?text_left

curl: (52) Empty reply from server

curl --data "@Camdata.txt" http://192.168.0.168:7999/1/config/set?text_left=

curl: (52) Empty reply from server

curl -d "$(Camdata.txt)" http://192.168.0.168:7999/1/config/set?text_left=

> -bash: Camdata.txt: command not found curl: (52) Empty reply from server

curl http://192.168.0.168:7999/1/config/set?text_left="TESTING_PLEASE_STANDBY" text_left = TESTING_PLEASE_STANDBY Done

I would be very grateful for any assistance.

I have also been given this bit of code, - they use it with rest.api - but all I want to do is read a series of values into a variable - and then push that variable as a string of text into motion:

TEXTLEFT=`curl --insecure --silent http://localhost:8181/weather/api/realtime/latest/metar`
TEXTLEFT="${TEXTLEFT// /%20}" #Replace spaces with %20
curl --silent "http://localhost:8080/101/config/set%3Ftext_left=$TEXTLEFT"

Again, I already have a Camdata.txt resource file that's produced locally, so I don't need to pull it from somewhere else - I just need to find a way to get Camdata.txt into TEXTLEFT and then use push TEXTLEFT into request. Totally driving me nuts and up until now, the most I've done with curl is install pihole!

Victor Lee
  • 2,467
  • 3
  • 19
  • 37
Ian Harvie
  • 11
  • 2

0 Answers0