scripting issues,..
#22956
Replies: 1 comment 2 replies
-
The basic way of having scripter code executed is to put it into the "Edit Script" page. I'd recommend making it work there, before going on to experiment with other ways. And you were not clear about your exact steps to "execute" it. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Trying to get my 1st script to run... but failing to tie all the dots together.
I am using the following compile directives:-
`#define USE_DISPLAY
#define USE_UNIVERSAL_DISPLAY
#define USE_SCRIPT_GLOBVARS
#define USE_DT_VARS
#ifndef USE_VEML7700
#define USE_VEML7700 // [I2cDriver50] Enable VEML7700 Ambient Light sensor (I2C addresses 0x10) (+4k5 code)
#endif
#ifndef USE_BMP
#define USE_BMP // [I2cDriver10] Enable BMP085/BMP180/BMP280/BME280 sensors (I2C addresses 0x76 and 0x77) (+4k4 code)
#endif`
and the basic code I am trying to run is as follows:-
`>D
; define all vars here
; reserve large strings
g:press=0
g:temp=0
dp1
dt [l1c1p10]temp=%temp% C
dt [l2c1p10]Press=%press% %%`
I assume the 'dt' is shortened displaytext command,.. but I cannot find any references, I am running the filename as 'my.tas' as I can format check in PIO,.. but I should name the file autoexec.bat... and then is will run the '>T' section of the code every teleperiod...
When I execute the script the SSD1306 ( Note essentially a mono chrome display, with top line of different colured LEDS ) display shows some random'ish text that is obviously part of the script itself... just not what I am expecting from displaytext command
My MQTT output,.. from which I am trying to capture the sensor data from is as follows:-
11:00:15.962 MQT: tele/Tas_Seventeen/STATE = {"Time":"2025-02-06T11:00:15","Uptime":"0T17:05:31","UptimeSec":61531,"Heap":19,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":3,"POWER":"ON","Wifi":{"AP":1,"SSId":"DiyNet0","BSSId":"9C:C9:EB:51:86:8F","Channel":9,"Mode":"11n","RSSI":76,"Signal":-62,"LinkCount":3,"Downtime":"0T00:00:24"}} 11:00:15.969 MQT: tele/Tas_Seventeen/SENSOR = {"Time":"2025-02-06T11:00:15","BMP280":{"Temperature":23.3,"Pressure":774.6},"PressureUnit":"mmHg","TempUnit":"C"} 11:03:13.102 UFS: File '/' download
What parts am I missunderstanding??
Many tx to all,...
Beta Was this translation helpful? Give feedback.
All reactions