Grove Vision AI V2 timeouts (Grove-I2C)

Hi, I am using the Grove Vision v2 connected to an Arduino Nano esp32 (Alvik Robot) using a Grove connector. But I have some issues, when I run a scan, it works:

Scan i2c bus…

i2c devices found: 3

Decimal address: 40 | Hexa address: 0x28
Decimal address: 43 | Hexa address: 0x2b
Decimal address: 98 | Hexa address: 0x62

It’s detecting the Grove Vision in the address 0x62, but when I try to READ or WRITE I am getting [Errno 116] ETIMEDOUT or [Errno 19] ENODEV. To start working, I need to press the white and black button (white first and black later) several times to enable bootloader mode (Grove Vision AI Module V2 | Seeed Studio Wiki). After multiple times (it’s random) the Grove starts answering:

buffer: bytearray(b’\r{“type”: 1, “name”: “INIT@SENSOR”, “code”: 0, “data”: {“sensor”: {“id”: 1, “type”: 1, “state”: 1, “opt_id”: 0, “opt_detail”: “240x240 Auto”}}}\n’)

I am getting this error with Micropython (Arduino Nano ESP32). Also I tried the official Seeed_Arduino_SSCMA.cpp (in a Cytron Maker Nano RP2040) and got the timeouts too.

In both cases I am connecting the Grove vision using the grove port (I2C), Is it normal? Do I have a failed Grove Vision V2?

If I connect the Grove Vision V2 kit using an USB connection to Ubuntu with Minicom, it works flawlessly. I throw commands (serial) and the Grove Vision v2 answer inmediately, I don’t need to reset it:
Welcome to minicom 2.9

OPTIONS: I18n
Port /dev/ttyACM0, 16:47:12

Press CTRL-A Z for help on special keys

{“type”: 0, “name”: “NAME?”, “code”: 0, “data”: “Grove Vision AI V2”}
{“type”: 0, “name”: “MODEL”, “code”: 0, “data”: {“model”: {“id”: 1, “type”: 0, }
{“type”: 0, “name”: “INVOKE”, “code”: 0, “data”: {“model”: {“id”: 1, “type”: 0,}
{“type”: 1, “name”: “INVOKE”, “code”: 0, “data”: {“count”: 1, “perf”: [7, 50, 0}

Tried a lot of things, reset the I2C bus, add waits between calls, everything failed.

Don’t know if someone else is using the Grove Vision v2 with the grove port, if you do it, Can you tell me your experience?

Thanks!

I think the problem is the voltage, the grove port in the Alvik robot is providing 3.3v, also the grove connector of the Cytron Maker Nano RP2040.
According what I read in the docs and also in this page (Grove Vision V2 Powered Pool Alert - Cranberry Grape | Cosmic Bee | Tim Lovett) the Grove Vision Ai V2 needs a grove connector with 5v. In my case the Grove Vision works with Alvik but it’s very unstable. I don’t know if anyone can confirm my suspicions.

Thanks!

The problem is not the voltage, my micropython code works perfect when I use the Cytron Maker Nano RP2040 comnected to the Grove Vision V2. But when I use the same code on the Arduino Alvik (Arduino Nano ESP32S3) I am getting the timeouts. This is my code:

from machine import I2C,Pin,SoftI2C
import utime
import sys
I2CADDRESS = 0x62
wait_delay=150
MAX_PL_LEN = 250


scl = 1
sda = 0

i2c = I2C(0,scl=Pin(scl),sda=Pin(sda),freq=104900)

print (i2c)

print()
print('Scan i2c bus...')
print()

devices = i2c.scan()

if len(devices) == 0:
    print("No i2c device !")
else:
    print('i2c devices found:',len(devices))
print()

for device in devices:
    print("Decimal address: ",device," | Hexa address: ",hex(device))

utime.sleep_ms(wait_delay)


while True:
    arr = bytes([0x10,0x06])
    try:
        i2c.writeto(I2CADDRESS,arr)
    except OSError as exc:
        print ("Reset error: " + str(exc))
        continue
    utime.sleep_ms(wait_delay)
    command = "AT+ID?"
    data ='{}\r\n'.format(command).encode('utf-8')
    print(data)
    size=len(data)
    utime.sleep_ms(wait_delay)
    arr = bytes([0x10,0x02,size >> 8,size & 0xFF]) + data
    try:
        i2c.writeto(I2CADDRESS,arr)
    except OSError as exc:
        print ("Write error: " + str(exc))
        continue   
    utime.sleep_ms(wait_delay)

    i2c.writeto(I2CADDRESS,bytearray([0x10,0x03]))
    buf = bytearray(2)
    utime.sleep_ms(wait_delay)
    try:
        i2c.readfrom_into(I2CADDRESS,buf)
    except OSError as exc:
        print ("Read avail error: " + str(exc))
        continue    
    utime.sleep_ms(wait_delay)
    length = (buf[0] << 8) | buf[1]

    print ("Length:" + str(length))
    stread = bytearray()
    i2c.writeto(I2CADDRESS,bytearray([0x10,0x01,length >> 8,length & 0xFF,0x00,0x00]))
    utime.sleep_ms(wait_delay)
    buf = bytearray(length)
    i2c.readfrom_into(I2CADDRESS, buf)
    stread.extend(buf)
    utime.sleep_ms(wait_delay)
    print(f'buffer: {stread}.')

The output of the code executed on the Cytron Maker Nano RP2040:

I2C(0, freq=104865, scl=1, sda=0, timeout=50000)

Scan i2c bus...

i2c devices found: 2

Decimal address:  40  | Hexa address:  0x28
Decimal address:  98  | Hexa address:  0x62
b'AT+ID?\r\n'
Length:59
buffer: bytearray(b'\r{"type": 0, "name": "ID?", "code": 0, "data": "48b3ac23"}\n').
b'AT+ID?\r\n'
Length:59
buffer: bytearray(b'\r{"type": 0, "name": "ID?", "code": 0, "data": "48b3ac23"}\n').
b'AT+ID?\r\n'
Length:59

And this is the output of the same code running on the Arduino Alvik (changing only the pins):

MicroPython v1.25.0 on 2025-04-15; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.
>>> 
raw REPL; CTRL-B to exit
>OKI2C(0, scl=12, sda=11, freq=105263)

Scan i2c bus...

i2c devices found: 3

Decimal address:  40  | Hexa address:  0x28
Decimal address:  43  | Hexa address:  0x2b
Decimal address:  98  | Hexa address:  0x62
b'AT+ID?\r\n'
Read avail error: [Errno 116] ETIMEDOUT
Reset error: [Errno 116] ETIMEDOUT
Reset error: [Errno 116] ETIMEDOUT
Reset error: [Errno 116] ETIMEDOUT

I will keep investigating what is the cause of the timeouts.

Thanks!

1 Like

For a stable experience, switch to using UART instead of I2C.
If you’re using Grove connectors, use a Grove UART to your ESP32 (Nano ESP32 supports it).
Avoid I2C unless you have no choice, and be prepared for inconsistent results.

3 Likes

I will check that option, thanks!