-
• #27
what about the result from the function, i.e i want to send ack back .
also i am having issue publishing on the nodered from another lan machine
-
• #28
maybe i should rephrase my last message,
what is the best way to execute a function within the puck and get a response
-
• #29
Any function with a return will give you a response to console. So will
Bluetooth.println
as per Gordon's post not both execute the function and send the returned response? That's the behaviour I would expect. -
• #30
Yes - instead of
"\x10Bluetooth.println(E.getTemperature())\n"
just do"\x10Bluetooth.println(yourfunction())\n"
It's all basically just the same as I'd explained earlier when you were trying with Python
-
• #31
thanks, so i have tried the following and it works but i do receive an echo of the input command. so i tried with the \x10, but this does not work, however i receive the following echoed back.
when issuing the following command
"beam(sleep)\n"
i get
{"topic":"/ble/data/d8:19:e7:5b:3a:57/nus/nus_rx","payload":"beam(sleep)\r\n","qos":0,"retain":false,"_msgid":"2846d788.245218"}
and
{"topic":"/ble/data/d8:19:e7:5b:3a:57/nus/nus_rx","payload":"=\"testing\"\r\n>","qos":0,"retain":false,"_msgid":"37141196.ec66fe"}
however when issuing the following command to rid of the echoed command
"\x10beam(sleep)\n"
i only get
{"topic":"/ble/data/d8:19:e7:5b:3a:57/nus/nus_rx","payload":"\"\x10beam(sleep)\n\"","qos":0,"retain":false,"_msgid":"7217a5c4.d44c8c"}
-
• #32
the following seems to works. all good thanks
\x10Bluetooth.println(beam(mycool))\n
-
• #33
In case anyone needs it, the Python code to transmit and receive is now at:
http://www.espruino.com/Interfacing#python
As is code in Node.js
You were so close!
It's basically the same: