Failed to init device

userHead Matha.Goram 2024-12-13 11:48:46 53 Views3 Replies

Error message:

(base) root@unihiker1:~/projects/unihiker/basic# python3 ./l_led.py

 ___________________________
|                           |
|      PinPong v0.5.2       |
|    Designed by DFRobot    |
|___________________________|

[01] Python3.10.14 Linux-4.4.143-67-rockchip-g01bbbc5d1312-aarch64-with-glibc2.28 Board: UNIHIKER
selected -> board: UNIHIKER serial: /dev/ttyS3
[10] Opening /dev/ttyS3
[32] Firmata ID: 0.0
[35] Burning firmware...
initialize
/root/miniforge3/lib/python3.10/site-packages/pinpong/base/FirmataExpress.UNIHIKER.3.8.bin
stm32flash -w /root/miniforge3/lib/python3.10/site-packages/pinpong/base/FirmataExpress.UNIHIKER.3.8.bin -v -g 0x08000000 /dev/ttyS3
stm32flash 0.5

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Failed to init device.

[37] Burn done
selected -> board: UNIHIKER serial: /dev/ttyS3
[10] Opening /dev/ttyS3
[22] Arduino compatible device found and connected to /dev/ttyS3
[40] Retrieving analog map...
Traceback (most recent call last):
 File "/root/projects/unihiker/basic/./l_led.py", line 44, in <module>
   Board().begin()
 File "/root/miniforge3/lib/python3.10/site-packages/pinpong/board.py", line 1369, in begin
   self.board = pymata4.Pymata4(com_port=self.serial, arduino_wait=2, baud_rate=115200, name = self.boardname)
 File "/root/miniforge3/lib/python3.10/site-packages/pinpong/base/pymata4.py", line 396, in __init__
   raise RuntimeError('*** Analog map retrieval timed out. ***'
RuntimeError: *** Analog map retrieval timed out. ***
Do you have Arduino connectivity and do you have the correct Firmata sketch uploaded to the board?
 

Python script:

from pinpong.extension.unihiker import *
from pinpong.board import Board, Pin
from unihiker import Audio
from unihiker import GUI

Board().begin()

 

A Linux desktop is connected to the UNIHIKER via USB-C port. I run Arduino IDE 2.3.4 to work on other DFRobot boards. What do I have to do to make Board().begin() work successfully? Thanks.

 

Regards.

 

 

 

2024-12-14 17:02:56

What if you use the default Python version: Python 3.7.3? Does it work?

userHeadPic Lupin
2024-12-13 22:03:15

The error indicates a problem with the communication between the pinpong library and the UNIHIKER board. An incompatibility between the pinpong library version and the board firmware may cause this problem. The correct Firmata firmware may not be uploaded or initialized properly on the UNIHIKER board.

 
userHeadPic lia.ifat
2024-12-13 20:24:31

The above issue is owing to the use of an obsolete PinPong package. Now that I'm on pinpon-0.6.1, I get a new message:

 

(base) root@unihiker1:~/# python
Python 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 21:44:20) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pinpong.board import Board
>>> Board().begin()
Please connect the development board !!!
Please connect the development board !!!
Please connect the development board !!!
 

However, the board is already connected to the desktop - currently running an SSH session. What else do I need to do? Thanks.

 

Regards.

userHeadPic Matha.Goram