Most recent activity
-
Hi,
I got a M5Stack thing with several I2C sensors. All work with Espruino. Awesome!
I got a LEGO+ module (AKA DC Motor) which can control Lego motors from the Mindstorm series. It works using M5Stack's microPython. Capabilities are limited to turn motor to speed -255..255 and read the encoder absolute values. The actual logic is handled by a Atmel Mega328. Here an example how you talk to it via Arduino code.It behaves as a I2C slave device (addr 0x56), but I cannot make it work using Espruino.
M5Stack has has several similar modules with on-board controller and I assume the way to talk to them is similar.
Does anyone have an example of talking to those M5Stack modules which are I2C slave devices? Any of them?This code does not work:
I2C1.writeTo(0x56, 0, 100, 0, 2);
which is (supposedly) matching line 43 of the LEGO_PLUS.ino sample code.
What am I missing? -
-
-
Nothing else running on it. I had more, but to debug this problem I removed anything else (not that much was running since it's very much space constrained).
Since the point is to display whatever is sent (up to 6 bytes, since it's a 6 character display), not much chopping up possible.
For power: It's using a USB power adapter. Never had problems with it.
Two different ESP8266 modules. Both with ESP12E: Wemos D1mini and a random NodeMCU module. -
-
Hi,
I have a small ESP8266 module which is supposed to receive simple data via simple TCP. The net module should do that and it works mostly:
var server = net.createServer(function(socket) { socket.on('data', function(data) { try { let a=JSON.parse(data); console.log(">"+JSON.stringify(a)); } catch(e) { console.log("ERROR: ", e); } }); socket.end(); }); server.listen(1234);
On the sender side I do a simple test via netcat:
for i in {0..4} ; do echo "{'toggle':$i}" | nc 192.168.21.105 1234 ; done
But what I get on the Espruino side is:
{"toggle":0}
{"toggle":2}
{"toggle":3}
{"toggle":4}
{"toggle":0}
{"toggle":1}
{"toggle":3}
{"toggle":4}
{"toggle":0}
{"toggle":1}
{"toggle":3}
{"toggle":4}
{"toggle":0}
{"toggle":1}
{"toggle":1}
{"toggle":2}
{"toggle":3}
{"toggle":4}which is not what I'd expect from TCP. I should see 0, 1, 2, 3, 4.
Even if I send one string at a time (and not 5 in a loop), it gets lost in about 20% of the cases.Am I doing something wrong? Is the net module on ESP8266 not working reliably?
Thanks for the quick reply Gordon!
And yes, setup is done:
Tried with [] and without, with 100 and 400 kbit/s
I cannot change the pins. I can see/detect the slave Mega328. I2C1 works for everything I throw at. I think I'm missing something to make the Lego+ module "start" somehow.
My hope is someone uses a M5Stack module and loves using Espruino on it too.