Comments (3)
I found the same... I found a little solution. Please comment....
def every_100ms()
if self.ser.available() > 0
var msg = self.ser.read() # read bytes from serial as bytes
import string
if size(msg) > 0
print("NSP: Received Raw =", msg)
if msg[0..1] == self.header
mode = "NSPanel"
var lst = self.split_55(msg)
for i:0..size(lst)-1
msg = lst[i]
if self.atc['mirror'] == true
if msg[2] == 0x84 self.ser.write(msg) # resend messages with type 0x84 for thermostat page
end
end
var j = size(msg) - 1
while msg[j] != 0x7D
msg = msg[0..-1]
j -= 1
end
msg = msg[5..j]
if size(msg) > 2
if msg == bytes('7B226572726F72223A307D') # don't publish {"error":0}
else
var jm = string.format("{\"NSPanel\":%s}",msg.asstring())
---> if ((string.find(jm,"}B}")) != -1)
---> var substring = string.split(jm, "}B}", 1)
---> jm = substring[0]+substring[1]+"}"
---> end
tasmota.publish_result(jm, "RESULT")
end
end
end
elif msg == bytes('000000FFFFFF88FFFFFF')
log("NSP: Screen Initialized") # print the message as string
self.screeninit()
else
var jm = string.format("{\"NSPanel\":{\"Nextion\":\"%s\"}}",str(msg[0..-4]))
tasmota.publish_result(jm, "RESULT") end
end
end
end
from nspanel.
I have a similar issue with a bad json payload, but on scene buttons. I have 3 scene buttons, but when I press on the last button, the last '}' is doubled.
Press on the second button gives me:
{"id":"2"}
Press on the third button gives me:
{"id":"3"}}
from nspanel.
See #27
from nspanel.
Related Issues (20)
- Stock tft file for EU HOT 5
- No touch after NspSend HOT 3
- Relais schalten nicht zuverlässig auf Tastendruck HOT 6
- Direct upload to nextion without esphome ? HOT 1
- [SOLDVED]{"NSPanel":{"error":2}} ... what is it ? HOT 1
- Curtain Widget (uuid = 11) doesn't show up HOT 1
- Question : Edit UI with Nextion HOT 1
- [SOLVED] No WiFi after tasmota flash HOT 5
- Display not showing correct temperature unit
- Change dateformat shown on screen ? HOT 3
- Add topic to the protocol documentation HOT 2
- Tasmota compilation HOT 2
- Freeze at Settings Scrren HOT 2
- Unclear HMI switch behavior HOT 1
- Locked by: Wipe down to "Settings of the screen brightness and sleep time" HOT 4
- HMI_weather stopped working (?) HOT 2
- How to enable NSPANEL PSRAM ? HOT 3
- NSpanel psram not working HOT 8
- Screen Backlight Turns on in Sleep Mode HOT 2
- Widget uuid "44 = dimmable light" does not exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nspanel.