'Autostart Terminal for Sensor Data Raspberry Pi
I use a Script for reading out a humidity sensor, the data is needed to turn on/off an heatwire (protection of condensation).
/etc/rc.local the python script autoboots
BUT
I also would like to auto open the terminal to see the live data of the sensor (Interface)
Should I write a Bash Script which autostarts a terminal and runs then the code?
King Regards Paul Matteschk
Solution 1:[1]
Make sure file /home/pi/.config/autostart/TerminalAutostartTest.desktop
is executable and put this inside:
[Desktop Entry]
Type=Application
Name=TerminalAutostartTest
Comment=Terminal Autostart Test
Exec=lxterminal -e /usr/bin/python3 /home/pi/test.py
Terminal=true
Works great opens terminal while booting and runs a python script.
Solution 2:[2]
What was needed was I needed to make a copy of my ThingyModel.cs
file and rename it to ThingyBodyModel.cs
.
In ThingyModel.cs
I replaced all my existing JsonProperties with
public class ThingyModel
{
/// <summary>
/// Model for Thingy API callback
/// </summary>
[JsonProperty(PropertyName = "body")]
public ThingyBodyModel Body { get; set; }
}
This allowed me to fix-up all my validators by just adding .Body
and to change the call shown for manager.SomeCallback(model)
to this:
var valuePairs = MethodToParseValues(model.Body.MemberValueThing);
where before it was just var valuePairs = MethodToParseValues(model.MemberValueThing);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | RiveN |
Solution 2 | gooddadmike |