Running Pixy with ESP32 or ESP8266? [SOLVED]

Added by mr ma 12 months ago

Has anyone managed to run Pixy with ESP32 or ESP8266?
I know both ESPs support Arduino IDE and can run most basic Arduino sketches, but with Pixy?


Replies (8)

RE: Running Pixy with ESP32 or ESP8266? - Added by Edward Getz 12 months ago

Hello Mr Ma,
That's a good question. I don't know of anyone who has done this. Regarding the Arduino support of the ESP devices, this might be a good starting point. You could take Pixys Arduino library and examples and compile them (hopefully) with little effort. The SPI implementations are likely to be slightly different, so some tweaking will probably be necessary.

Edward

RE: Running Pixy with ESP32 or ESP8266? - Added by mr ma 7 months ago

Answering to my own question, here is how to connect ESP32 to Pixy over SPI,

Picture1.png (1.2 MB)

RE: Running Pixy with ESP32 or ESP8266? - Added by mr ma 7 months ago

I've tested it on ESP32 core on Arduino IDE, you may want to include ESP32 SPI.h locally in order to make sure you are not using the Arduino one.

And, if your ESP32 board is somewhat different you can get the SPI pins by running these commands:

Serial.print("MOSI:"); Serial.println(MOSI);
Serial.print("MISO:"); Serial.println(MISO);
Serial.print("SCK:"); Serial.println(SCK);

RE: Running Pixy with ESP32 or ESP8266? [SOLVED] - Added by Edward Getz 7 months ago

Hello Mr. Ma,
Thanks for sharing!

RE: Running Pixy with ESP32 or ESP8266? [SOLVED] - Added by Olaf Lampe 6 months ago

Hello Mr. Ma!
Your post inspired me to start a WiFi project myself, but with ESP8266 NodeMCU.
I'm no expert, but IMHO the best protocol for the Pixy is UDP. [[https://en.wikipedia.org/wiki/User_Datagram_Protocol]]
Because it has a minimal header and exchanges data-blocks in predefined size. There are also sample programs for WiFiUDP in arduino IDE, so it should be easy to use.

What are your plans regarding data protocol?

RE: Running Pixy with ESP32 or ESP8266? [SOLVED] - Added by Olaf Lampe 6 months ago

Here's a short test program I cobbled together from several example progs.
It inits the ESP to work as soft_access_point with DHCP and opens a UDP channel.
When a Wifi client is logged in, it can send strings like "getBlocks" or "setServo".
The ESP compares the string and takes action. For now it works over serial port, but that's easy to change.

RE: Running Pixy with ESP32 or ESP8266? [SOLVED] - Added by Olaf Lampe 6 months ago

FYI: For Wemos mini users, you have to include the SPIslave.h library.
I could run the hello_world example 5 times faster than with an arduino nano.
The Esp8266 runs now at 80Mhz, but can also run 160Mhz fast. So there's room for more.

ESP8266_SPI.jpg (317.2 kB)

RE: Running Pixy with ESP32 or ESP8266? [SOLVED] - Added by zain nasir 5 months ago

Hi,

You should have a look at Arduino UNO Pinout . I think it will help you out.

Thanks.

(1-8/8)