Hi,
I've managed to get the temperature and put it into a variable :
Code: Select all
temp_ext=$(curl -s 'http://192.168.1.45:8082/json.htm?type=devices&rid=59' | awk -F "\"" '/Data/ {print $4}')
IDX 59 being my temperature sensor
When I type :
It displays the temperature.
BUT when putting it into a shell script, that does not work, and I can't figure out why :
Code: Select all
sudo nano /home/pi/scripts/get_sensors_values.sh
Code: Select all
#!/bin/bash
temp_ext=$(curl -s 'http://192.168.1.45:8082/json.htm?type=devices&rid=59' | awk -F "\"" '/Data/ {print $4}')
Code: Select all
sudo chmod +x /home/pi/scripts/get_sensors_values.sh
I then execute the script :
And when typing :
It does not display the
last temperature.
Does anybody have any idea how I could fix this?
Once I will have solved that, I still need to figure out how to put this variable within a blockly script, in order to send it by email.
Julien