-
-
Hi,
I'm wondering whether it's possible to connect one master Rasbery Pi 3 using the GPIO serial pins to many slave Espruino devices through only RX and TX. (only 2 pins)
Looking at the pin diagrams for each the PI is labeled as UART while the Espruino is labeled with USART. Is this a problem?
I've also been reading some articles talking about voltage differences, does anyone have any insight into whether this is possible and what we need to consider?
http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/
https://oscarliang.com/raspberry-pi-and-arduino-connected-serial-gpio/Thank,
Victor -
So we've found a few things but I'm not sure if they are any help.
Master receive LED is flashing but barely. (Slave is sending but master not receiving)
Does it matter that three different voltage regulators are being used with the three picos. May we need to connect them up afterward the regular in parallel?
May we need more pull up resistors if there are more slaves?
-
Sorry to keep bothering you. We connected LEDs and they seem to be flashing correctly. (Apart from slaves send back to master in which case slave send flashes but master receive does not)
I've attached a couple of pictures of our designs and I was just wondering if you could have a quick look. I believe it may be something with the electronics as our testing results seem quite inconsistent.
Thanks!
-
-
-
We are currently using the below code with no success. The slaves are connected through a USB connector so do we need a 4.7k pull-up resistor on each slave or just once? (Currently we have one)
//Master E.setBootCode("function cmdOnSlave(slave, cmd) { Serial1.println('if(ID==\"' + slave + '\")' + cmd + ';'); } USB.setConsole(true); // make sure console stays off Serial1 var line = ''; Serial1.on('data', function(d) { line += d; i = line.indexOf('\n'); while (i >= 0) { console.log(line.substr(0, i)); // do stuff with data line = line.substr(i + 1); i = line.indexOf('\n'); } }); ", true) //Slave E.setBootCode(" var ID = getSerial(); pinMode(B6, 'af_opendrain'); echo(0); ", true);
-
We have been experimenting with multiple slaves using the information above but are unable to get the response working with more than one. (Same issue @user66543 was having)
The strange thing is whenever uncomment the pinMode function communication does not work at all. Is this the correct way to use on init below?
E.setBootCode(" E.on('init', function() { echo(0); //pinMode(B6, 'af_opendrain'); }); var ID=getSerial(); function xgmSlave(ledid,onoff) { digitalWrite(ledid,onoff); }; ", true);
-
Thanks @Gordon this is really useful, I'll give it a go.
-
Hi,
I'm just wondering if anyone has any insight on one master Espruino pico communicating with four slave Espruino pico devices.
I'm currently looking at I2C though the documentation says "master only".
Or would I be able to use serial communication with multiple devices? (I assume I would need to implement an addressing system in the program myself)Thanks,
Victor
Thanks @Gordon we'll give it a try and let you know how it goes.