1

I am looking for a DIY replacement for the $1500 Go-Box for mass provisioning Chromebooks. I have managed to replicate this by using a Raspberry Pi Pico as the "HID Emulation". However, I need this on a mass scale. I want to be able to do 20 Chromebooks at one time. I can do this with just 20 Raspberry Pi Picos but I need to change the script every 100-150 Chromebooks I provision (changing credentials etc.). Changing each script manually is time-consuming, so I need to be able to change all 20 scripts at once, or one "master" script that the "slave" Picos go and get on boot.

At first, I thought about an SD card they can all read from and when needed, I can take it out and change the script on there, and then when the Pico boots it can copy the new script to the root of the Pico. However, this may be an issue since I do not know if the Picos will clash with each other when trying to read the script from the same place at the same time. This is my first issue.

Then I thought about a Master and Slaves setup. One Pico acts as a Master and holds the script. The other 20 are slaves that get the script from the Master when a pin is high (to signify the Picos need reprogramming). I would only use the Master when reprogramming the script. When I turn the Master on, I would have it set a pin to high and all the other slaves would check on the boot to see if the pin is high. If the Slaves find that the pin is high, it won't run the script, but it will update it from the Master. This is where I run into the problem with this method. I need to transfer the script from Master to Slaves. I haven't got any experience in communication protocols like UART, SPI, or I2C but I understand that if I want to do multiple Slaves, then I am better off using I2C.

This is my last resort since I have been googling for days and can't find a suitable solution. Is anyone able to provide any insight on any of the following:

  • How to get the script from one place to twenty?
  • Will the SD card idea clash when all 20 Picos try to access it?
  • How to transfer files over I2C or similar protocol?

I appreciate any help anyone can provide. I am using MicroPython v1.16 on 2021-06-18; Raspberry Pi Pico with RP2040

BDL
  • 21,052
  • 22
  • 49
  • 55
Nathan
  • 65
  • 1
  • 4
  • 14
  • 1
    I think you're on the right path. i2c is very easy to implement. Instead of the slaves requesting from the master, just inverse it -- don't allow the slave devices to write until their config has been verified, which the master will systematically do 1 by 1. – Teejay Bruno Jul 20 '21 at 21:39
  • 2
    However, if you're not locked to the pico, I would recommend something like the esp32 which will also run micropython but has built in wifi. This way they can all wirelessly and easily request the proper config from a repo/server you manage. – Teejay Bruno Jul 20 '21 at 21:41
  • Thanks for the reply! The microcontroller needs to support HID emulation, which is why I chose the Pico. How would I got about doing what you said in your first comment? – Nathan Jul 21 '21 at 06:08
  • You would give each pico a unique i2c address and could perform what you mentioned previously in regards to the master pin state. Once the master has gone through all addresses and verified the correct file, set the flag (or pin in this case) and allow the slaves to write. – Teejay Bruno Jul 21 '21 at 15:49
  • 1
    `ansible` is what you are looking for. – 0andriy Jul 21 '21 at 20:49
  • 1
    @0andriy this [Ansible](https://en.wikipedia.org/wiki/Ansible_(software))? – Nathan Jul 21 '21 at 21:04
  • @TeejayBruno another option could be to use an ESP32 or ESP8266 as a wireless network adapter for the Pico - there's some discussion of this on the Pico section of the [MicroPython forum](https://forum.micropython.org/viewforum.php?f=21) if you have a browse. – nekomatic Jul 29 '21 at 08:22

1 Answers1

2

The pico has a uart (2 actually) which is easy to program; there are lots of examples of serial communication with the pico, typically to a full Raspberry Pi.

You could join all the rx receiver pins on the picos to the master tx transmit pin and talk to them all in parallel, with no replies. I don't know if it is possible to tri-state the tx pins so that they could all be connected too, but only one enabled at a time, by sending suitable commands from the master tx. The problem is that the electrical load of 20 receivers, and the excessive length of the parallel cabling might not give error free transfers.

Or you could daisy chain the serial ports so the rx of pico1 is read by the software there and repeated out on its tx, which is connected to the rx of pico2, and so on. You can start each data packet with a "node number", which each pico decrements before sending it on. If this number is 1, then the packet appplies to this node. This is a sort of auto-numbering of the picos. A number like 255 can be used for a broadcast.

If the last pico's tx is wired back to the master you can even allow any pico to send a reply, provided the software waits for a break in incoming data. It also allow for rudimentary flow control and error checking. If the master sends only 1 byte at a time, and waits for each byte to be "echoed" back from the last pico, it can ensure everyone has seen the data. Also, each serial segment can be short so there are no electrical load problems, or signal corruption.

Look at the gpib bus which daisy chains something like this, or at the simple individually-addressible RGB leds like the WS2812B which are also daisy chained.

meuh
  • 11,500
  • 2
  • 29
  • 45
  • I like the sound of the first paragraph. It seems possible, at least in my head. The idea of daisy-chaining seems a lot more possible. I would need to test both, I'm currently waiting on my Pico's to turn up in the post. I will let you know how it goes! Thanks! – Nathan Jul 21 '21 at 21:03