Hi Gordon,
Many thanks for the response.
I decided to make an app for this to make things a bit more visible.
However I get an error with json.dumps, which is
Traceback (most recent call last):
File "/home/pi/bleak-test.py", line 15, in <module>
command = b"X("+json.dumps(dict)+")\n"
TypeError: can't concat str to bytes
I added this snippet to bleak to creates the variable.
import json
[#create](https://forum.espruino.com/search/?q=%23create) dictionary for the data to be sent
dict = {'Code': '10'}
And for completeness my app does this
E.showMessage("Hello Code");
function X(dict) {
E.showMessage(dict);
}
So do I have to convert the json to bytes?
Thanks for your patience
mike
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi Gordon,
Many thanks for the response.
I decided to make an app for this to make things a bit more visible.
However I get an error with json.dumps, which is
I added this snippet to bleak to creates the variable.
And for completeness my app does this
So do I have to convert the json to bytes?
Thanks for your patience
mike