This device generates serial data. Port settings are available via this GUI-O interface.
Possible settings are text, baudrate, data offset and random number.
AVR microcontroller is used.
This device generates serial data. Port settings are available via this GUI-O interface.
Possible settings are text, baudrate, data offset and random number.
AVR microcontroller is used.
@Bernard
In your Sub, the Return statement is used twice. Maybe that's the problem.
After first return statement must be:
Guio_ini_2:
@hls 250 should be at the end of the Init procedure.
I checked the Init process without the Bascom code and it works OK.
Maybe put |CH
|CH UID:ch0 X:50 Y:75 W:50 H:50 XLO:0 BSZ:120 VLP:2 BGC:#E53A4456 FGC:#EF33EAF5 SHE:1 FSZ:2.5 RAD:1 CHT:2 CHN:'MESURE HUM / TEMP / PRESSION' XTC:12 YTC:6 YMA:4 XMA:2 XHI:75 PZO:0
@hls 250
just before @hls 250
Otherwise, your GUI-O screen is very nice
Here is an example of using a water level gauge in tanks, controlled via a WiFi network.
This device generates serial data. Port settings are available via this GUI-O interface.
Possible settings are text, baudrate, data offset and random number.
AVR microcontroller is used.
This is example Init :
https://forum.gui-o.com/topic/223/gui-o-energy-meter
@sls 500
@cls
@clh
@clo
@gse COD:0 TSC:39
@guis BGC:#000000 ASR:0.449671
|IM UID:im0 X:50 Y:50 W:100 H:100 ROT:0 SHE:0 VIS:1 ACT:0 OPA:1 SCM:1 PLS:1 IP:'https://i.imgur.com/zZuSWyR.png'
|IM UID:imlcd X:50 Y:20 W:90 H:90 ROT:0 SHE:1 SHHR:2 SHVR:2 VIS:1 ACT:0 OPA:1 IP:'https://i.imgur.com/WGJpsI4.png'
|LB UID:lben X:50 Y:20.5 ALP:0 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#000000 FSZ:4 FFA:'font8' TXT:'25,101 KWh'
|LB UID:lbv X:5 Y:35 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'231.048 V'
|LB UID:lba X:5 Y:40 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'0.057 A'
|LB UID:lbw X:5 Y:45 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'7.229 W'
|LB UID:lbf X:5 Y:50 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'50.000 Hz'
|LB UID:lbp X:5 Y:55 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'PF:1.000'
|LB UID:lbw1 X:5 Y:60 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'Wmax 47.046 W'
|LB UID:lb0 X:50 Y:6 ALP:0 SHE:1 ROT:0 FGC:#FFFFFF FSZ:5 FFA:'font7' TXT:'Energy Meter'
|BSR UID:bsrsh X:52 Y:78 W:95 H:27 RAD:0 OPA:0.5 BGC:#000000 SBGC:#000000 FGC:#000000 BTH:0
|CH UID:pl1 X:50 Y:77 W:95 H:27 SHE:1 VIS:1 OPA:1 PZO:1 BGC:#000000 FGC:#FFFFFF CHT:0 FSZ:1.2 SHVL:1 VLP:0 CHN:'ENERGY METER' RAD:0.5 BTH:0 LT:0.3 XTC:6 YTC:5 XMA:6 YMA:4 YLO:0 YHI:10 SHG:0 DRAT:0.90 DRA:50
|IM UID:imexit X:85 Y:95 W:14 H:14 ROT:0 SHE:1 SHHR:1 SHVR:1 VIS:1 OPA:1 SCM:2 PLS:1 IP:'https://i.imgur.com/8hDtY92.png'
|LB UID:lbms X:5 Y:95 ALP:1 SHE:1 ROT:0 FGC:#FFFFFF FSZ:2.5 FFA:'font7' TXT:'(c) gammda 2024'
@hls 200
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,1.7,1.1,6' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.8,2.2,8' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.4,1.8,7' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'2,3.2,1.6,4' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,2.3,2.2,4.5' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5,2.2,1.6,4.8' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5.4,1.7,1.1,3.4' XP:'0,0,0,0'
I noticed that LB widgets are missing from my GUI-O app this morning. I thought something was wrong with my smartphone. I checked this on my Samsung tablet where the previous version of GUI-O is installed. And it worked fine there. After updating to version 1.0.90, the same problem occurs. Is it possible that there is something wrong with the new version of GUI-O?
Here is a Energy Meter that uses the MODBus protocol and GUI-O.
>>Init file
@sls 500
@cls
@clh
@clo
@gse COD:0 TSC:39
@guis BGC:#000000 ASR:0.449671
|IM UID:im0 X:50 Y:50 W:100 H:100 ROT:0 SHE:0 VIS:1 ACT:0 OPA:1 SCM:1 PLS:1 IP:'https://i.imgur.com/zZuSWyR.png'
|IM UID:imlcd X:50 Y:20 W:90 H:90 ROT:0 SHE:1 SHHR:2 SHVR:2 VIS:1 ACT:0 OPA:1 IP:'https://i.imgur.com/WGJpsI4.png'
|LB UID:lben X:50 Y:20.5 ALP:0 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#000000 FSZ:4 FFA:'font8' TXT:'25,101 KWh'
|LB UID:lbv X:5 Y:35 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'231.048 V'
|LB UID:lba X:5 Y:40 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'0.057 A'
|LB UID:lbw X:5 Y:45 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'7.229 W'
|LB UID:lbf X:5 Y:50 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'50.000 Hz'
|LB UID:lbp X:5 Y:55 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'PF:1.000'
|LB UID:lbw1 X:5 Y:60 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'Wmax 47.046 W'
|LB UID:lb0 X:50 Y:6 ALP:0 SHE:1 ROT:0 FGC:#FFFFFF FSZ:5 FFA:'font7' TXT:'Energy Meter'
|BSR UID:bsrsh X:52 Y:78 W:95 H:27 RAD:0 OPA:0.5 BGC:#000000 SBGC:#000000 FGC:#000000 BTH:0
|CH UID:pl1 X:50 Y:77 W:95 H:27 SHE:1 VIS:1 OPA:1 PZO:1 BGC:#000000 FGC:#FFFFFF CHT:0 FSZ:1.2 SHVL:1 VLP:0 CHN:'ENERGY METER' RAD:0.5 BTH:0 LT:0.3 XTC:6 YTC:5 XMA:6 YMA:4 YLO:0 YHI:10 SHG:0 DRAT:0.90 DRA:50
|IM UID:imexit X:85 Y:95 W:14 H:14 ROT:0 SHE:1 SHHR:1 SHVR:1 VIS:1 OPA:1 SCM:2 PLS:1 IP:'https://i.imgur.com/8hDtY92.png'
|LB UID:lbms X:5 Y:95 ALP:1 SHE:1 ROT:0 FGC:#FFFFFF FSZ:2.5 FFA:'font7' TXT:'(c) gammda 2024'
@hls 200
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,1.7,1.1,6' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.8,2.2,8' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.4,1.8,7' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'2,3.2,1.6,4' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,2.3,2.2,4.5' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5,2.2,1.6,4.8' XP:'0,0,0,0'
@pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5.4,1.7,1.1,3.4' XP:'0,0,0,0'
Here is one example of adding an Eyra electronics MPPT-100 MPPT solar charger remote control device.
[https://www.eyra-elektronika.si/solarni-regulator.htm](link url)
It's a great product, now I can control it remotely via WiFi and GUI-O.
I use the RS232 port to communicate with the device.
Check the communication lines. Be careful not to connect the RX and TX pins of the ESP8266 together with the Rx and Tx pins of the Bluetooth module.
I generally use ESP826612F in SMD or Wemos D1 mini version. Sometimes it happened that some information was missing in a very long text. I solve this problem by separating the sent text in two messages on ESP.
It may also happen that the ESP does not work properly and needs to be replaced with another one.
It is possible that you are using a While - Wend loop that never ends because the Sig_Sim parameter is always "0".
Check your code and change the Sig_sim variable to 1 at some point during runtime.
Maybe you should try changing the While - Wend with an IF - ENDIF statement.
Alternatively, maybe modify Ischarwaiting() with serial interrupts something like this:
On Urxc Rxcom1_isr
Enable Urxc
Dim Rxdata1$ As String * 80
Dim Rxdata As Bit
Dim Comchar1 As Byte
Enable Interrupts
Do
If Rxdata = 1 Then
Reset Rxdata1
Print Rxdata1$ 'do something with your received data
End If
Loop
Rxcom1_isr:
Comchar1 = Inkey()
Rxdata1$ = Rxdata1$ + Chr(comchar1)
If Comchar1 = 13 Then ' detect end of line can be 10 or any other char.
Set Rxdata
End If
Return
, but it will completely change the concept of your code.