I’m using a Wio Terminal with the Arduino IDE and I’m getting an error when I try to compile the openmv_popular_features_as_the_control_device_example.
The Wio Terminal uses a SAMD51 device which does not use Software Serial but it does have a second Hardware Serial port that is used as a UART (Serial1). I tried uncommenting the line for hardware_serial1 but I get the following error: ‘rpc_hardware_serial1_uart_master’ in namespace ‘openmv’ does not name a type
Here is the block of code with the line I uncommented at the end:
// Uncomment the below line to setup your Arduino for controlling over a hardware UART.
//
// * baudrate - Serial Baudrate.
//
// NOTE: Master and slave baud rates must match. Connect master tx to slave rx and master rx to
// slave tx. Finally, both devices must share a common ground.
//
// WARNING: The program and debug port for your Arduino may be “Serial”. If so, you cannot use
// “Serial” to connect to an OpenMV Cam without blocking your Arduino’s ability to
// be programmed and use print/println.
//
// openmv::rpc_hardware_serial_uart_master → Serial
// openmv::rpc_hardware_serial1_uart_master → Serial1
// openmv::rpc_hardware_serial2_uart_master → Serial2
// openmv::rpc_hardware_serial3_uart_master → Serial3
//
openmv::rpc_hardware_serial1_uart_master interface(115200);
I am using the Seeed SAMD Boards package version 1.7.9
The specific board is the Seeeduino Wio Terminal.
There are 3 hardware serial ports configured
Serial for the monitor/upload port
Serial1 for the available UART ← this is what I am trying to use
Serial2 for the WiFi/BT interface
You might also want to add to the instructions which pins on the camera to use (or did I just totally miss them?). I looked at the pinout and didn’t realize there were two UARTs and I2C buses to choose from and so I was getting the “1 second and freeze” problem.
BUT, after a little more investigation, I did get it working with both hardware UART and I2C on a Pololu A-Star (Leonardo). it’s all pretty slick!
where did you make the code update? I am having a similar issue using ESP32.
Code
// Uncomment the below line to setup your Arduino for controlling over a hardware UART.
//
// * baudrate - Serial Baudrate.
//
// NOTE: Master and slave baud rates must match. Connect master tx to slave rx and master rx to
// slave tx. Finally, both devices must share a common ground.
//
// WARNING: The program and debug port for your Arduino may be "Serial". If so, you cannot use
// "Serial" to connect to an OpenMV Cam without blocking your Arduino's ability to
// be programmed and use print/println.
//
// openmv::rpc_hardware_serial_uart_master -> Serial
// openmv::rpc_hardware_serial1_uart_master -> Serial1
// openmv::rpc_hardware_serial2_uart_master -> Serial2
// openmv::rpc_hardware_serial3_uart_master -> Serial3
//
openmv::rpc_hardware_serial2_uart_master interface(115200);
Error Message
Arduino: 1.8.15 (Windows Store 1.8.49.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
image_transfer_jpg_as_the_controller_device_example:60:9: error: 'rpc_hardware_serial2_uart_master' in namespace 'openmv' does not name a type
openmv::rpc_hardware_serial2_uart_master interface(115200);
^
Because of the SERIAL_PORT_HARDWARE definition for the SAMD parts I was just able to use the default Serial, i.e. I changed the code to “openmv::rpc_hardware_serial_uart_master interface(115200);”.
Not sure if this fix will work with your ESP32 board. I found the definition for the Wio Terminal in the variant.h file.