This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with tinycore + pypilot hat / Does not find IMU
#1
Hello all,

I am experiencing an issue with recently received pypilot hat from Sean store hooked to a raspberrypi zero with tinypilot (latest distribution : https://pypilot.org/download.php?Down=im..._27.img.xz).

The issue is with the IMU detection :
  - Raspberrypi zero with tinypilot tinypilot_2020_10_27.img.xz
  - Motor controller not connected (I am testing first the hat and then will hook the controller)
  - At start, after splashscreen, the LCD screen display : error compass or gyro failure
  - the pypilot log report the following :
Code:
2020-03-14_11:00:17.53101 ERROR loading intellect.py invalid syntax (intellect.py, line 205)   invalid syntax (intellect.py, line 205)                                                                    
2020-03-14_11:00:17.53191 ERROR loading learning.py invalid syntax (intellect.py, line 205)   invalid syntax (intellect.py, line 205)                                                                    
2020-03-14_11:00:17.83332 Settings file RTIMULib.ini loaded                                                                                                                                              
2020-03-14_11:00:17.83376 Failed to open settings file for saveFailed to open SPI bus 0, select 0                                                                                                        
2020-03-14_11:00:17.84324 Failed to open SPI bus 0, select 1                                                                                                                                              
2020-03-14_11:00:17.84331 No IMU detected                                                                                                                                                                
2020-03-14_11:00:17.84335 Using fusion algorithm Kalman STATE4                                                                                                                                            
2020-03-14_11:00:18.16319 loading servo calibration /home/tc/.pypilot/servocalibration                                                                                                                    
2020-03-14_11:00:18.16335 WARNING: using default servo calibration!!                                                                                                                                      
2020-03-14_11:00:18.16343 Loaded Pilots: ['absolute', 'basic', 'simple']                                                                                                                                  
2020-03-14_11:00:18.16352 warning: failed to open special file /dev/watchdog0 for writing                                                                                                                
2020-03-14_11:00:18.16360          cannot stroke the watchdog                                                                                                                                            
2020-03-14_11:00:18.84126 Failed to open SPI bus 0, select 0                                                                                                                                              
2020-03-14_11:00:18.84137 Failed to open SPI bus 0, select 1                                                                                                                                              
2020-03-14_11:00:18.84142 No IMU detected                                                                                                                                                                
2020-03-14_11:00:18.84147 Using fusion algorithm Kalman STATE4                                                                                                                                            
2020-03-14_11:00:19.84542 Failed to open SPI bus 0, select 0                                                                                                                                              
2020-03-14_11:00:19.84554 Failed to open SPI bus 0, select 1                                                                                                                                              
2020-03-14_11:00:19.84559 No IMU detected
    I am not certain about the 'Failed to open SPI bus 0'
  - Verification of i2c connexion to the IMU (after installing i2cdetect on tinycore : tce-load -wi i2c-tools):
Code:
tc@box:~$ i2cdetect -y 1
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
    The address seems to correspond to MPU9255
  - Check of running python code

Code:
tc@box:~$ ps -A | grep pilot
 572 root     runsv pypilot_hat
 579 root     runsv pypilot_web
 581 root     runsv pypilot
 584 tc       svlogd -tt /var/log/pypilot_hat
 586 tc       svlogd -tt -b 24 -l 16 /var/log/pypilot_web
 587 tc       svlogd -tt -b 24 -l 16 /var/log/pypilot
 960 tc       {python3.6} pypilot /usr/local/lib/python3.6/site-packages/pypilot/autopilot.py
1030 root     {python3.6} pypilot_hat /usr/local/lib/python3.6/site-packages/pypilot/hat/hat.py
1319 tc       {python3.6} pypilot /usr/local/lib/python3.6/site-packages/pypilot/autopilot.py
1320 tc       {python3.6} pypilot /usr/local/lib/python3.6/site-packages/pypilot/autopilot.py
1327 tc       {python3.6} pypilot /usr/local/lib/python3.6/site-packages/pypilot/autopilot.py
1328 tc       {python3.6} pypilot /usr/local/lib/python3.6/site-packages/pypilot/autopilot.py
1331 tc       {python3.6} pypilot /usr/local/lib/python3.6/site-packages/pypilot/autopilot.py
1332 tc       {python3.6} pypilot /usr/local/lib/python3.6/site-packages/pypilot/autopilot.py
1371 root     {python3.6} pypilot_hat /usr/local/lib/python3.6/site-packages/pypilot/hat/hat.py
1372 root     {python3.6} pypilot_hat /usr/local/lib/python3.6/site-packages/pypilot/hat/hat.py
2495 root     {pypilot_web} /usr/local/bin/python3.6 /usr/local/bin/pypilot_web 80
4394 tc       grep pilot
    This seems to indicate that all pypilot code is running as expected (autopilot, web and hat)
  - Trial with previous tinypilot distribution (https://pypilot.org/download.php?Down=im...019.img.xz) gives similar behavior (no IMU detection).

Would someone have any hint about this situation, experienced something similar or have any suggestion ?

Best regards,

Xavier.
Reply
#2
Hello,

Some news after more testing:
  - Test of the tinypilot distribution with an available MPU9250 (after dismantling the hat) : OK; pypilot_boatimu shows IMU being foudn as expected
  - Test of the hat on a raspberrypi4 with openplotter / pypilot_boatimu :

Code:
failed to load /home/pi/.pypilot/pypilot.conf [Errno 2] No such file or directory: '/home/pi/.pypilot/pypilot.conf'
backup data failed as well [Errno 2] No such file or directory: '/home/pi/.pypilot/pypilot.conf.bak'
failed to load /home/pi/.pypilot/pypilot.conf [Errno 2] No such file or directory: '/home/pi/.pypilot/pypilot.conf'
backup data failed as well [Errno 2] No such file or directory: '/home/pi/.pypilot/pypilot.conf.bak'
Settings file not found. Using defaults and creating settings file
Using settings file RTIMULib.ini
No IMU detected
Using fusion algorithm Kalman STATE4
no IMU detected... try again
Using settings file RTIMULib.ini
No IMU detected
Using fusion algorithm Kalman STATE4
no IMU detected... try again
Using settings file RTIMULib.ini
No IMU detected
Using fusion algorithm Kalman STATE4
no IMU detected... try again
Using settings file RTIMULib.ini
No IMU detected
Using fusion algorithm Kalman STATE4
no IMU detected... try again
Using settings file RTIMULib.ini
No IMU detected
Using fusion algorithm Kalman STATE4
no IMU detected... try again
^Cgot signal 2 cleaning up
got signal 2 cleaning up
got signal 2 cleaning up
got signal 2 cleaning up
got signal 15 cleaning up
got signal 15 cleaning up

Conclusion : the issue seems to lie with the hat.

Maybe Sean may suggest other tests to run with the pypilot hat.
Reply
#3
Hello,

Last addition to tests list ; I measured the voltage Vcc at the MPU9255 and found 1.7V (looking at the schematics, 3.3V should be expected ; the MPU9250 I had is expecting 3.3V). Close inspection showed an open jumper J10 with one side connected to pin1 (3.3V) of the 40pin connector of the rapsberrypi while the other is connecter to MPU9255 Vcc.

   

I am wondering if J10 should be closed to supply 3.3V to the MPU9255.

Sean, could you comment on this ?

Best regards,

Xavier.
Reply
#4
The mystery is solved because the imu is icm20948 which needs newer rtimulib2.
Reply
#5
Hello,

OK ; as Sean posted, mistery is solved :
  - IMU is no longer MPU9255 but ICM20948 (https://invensense.tdk.com/download-pdf/...datasheet/) which is powered between 1.71V and 3.6VDC.
  - Pypilot hat is (according to Sean) mainly shipped with this IMU rather than the MPU9255
  - J10 jumper then make sense as transition between MPU9255 (3.3V) and ICM20948 (1.7V)
  - tinypilot_2020_10_27.img.xz image does not include this driver within its IMU library ; it has been recently added to Sean's repository (git://github.com/seandepagnier/RTIMULib2.git) ; compilation needed.

I'll give a try to RTIMULib2 compilation under tinypilot_201027 and will post the results.

Thanks,

Xavier.
Reply
#6
Yes the J10 would be closed if a device using 3.3v were used in place. When left open the 1.8v levels are used.
Reply
#7
Hello,

OK ; compilation executed and everything works fine by now.

Here follows the commands for compilation for the ones interested with tinypilot_2020_10_27.img.xz image:
Code:
# *** Compile last git version of RTIMULib2 ***
# Prepare directories, get last git and compress in .tar.gz (expected by python-RTIMULib.build)
cd ~
mkdir RTIMULib_update
cd RTIMULib_update
git clone git://github.com/seandepagnier/RTIMULib2.git
tar czvf RTIMULib2.tar.gz RTIMULib2
rm -rf RTIMULib2
# Extract, rename, compile and generate squashfs (to make persitent)
sudo sh /mnt/mmcblk0p2/tinypilot/pypilot_dependencies/python-RTIMULib/python-RTIMULib.build

# *** Reboot... ***
sudo reboot
The script python-RTIMULib.build execute the compilation and generation of the package necessary for the specific structure (RAM filesystem) of tinycore (tinypilot base) ; looking at the code is interesting.

Here is the extract of /var/log/pypilot/current:
Code:
2020-03-14_11:00:17.41751 ERROR loading intellect.py invalid syntax (intellect.py, line 205)   invalid syntax (intellect.py, line 205)
2020-03-14_11:00:17.41853 ERROR loading learning.py invalid syntax (intellect.py, line 205)   invalid syntax (intellect.py, line 205)
2020-03-14_11:00:17.67724 Settings file RTIMULib.ini loaded
2020-03-14_11:00:17.67736 Failed to open settings file for saveDetected ICM20948 at standard address
2020-03-14_11:00:17.68017 Failed to open settings file for saveUsing fusion algorithm Kalman STATE4
2020-03-14_11:00:17.68030 min/max compass calibration not in use
2020-03-14_11:00:17.68334 Using ellipsoid compass calibration
2020-03-14_11:00:17.68341 Using accel calibration
2020-03-14_11:00:18.00325 ICM-20948 init complete
2020-03-14_11:00:18.07324 loading servo calibration /home/tc/.pypilot/servocalibration
2020-03-14_11:00:18.07338 WARNING: using default servo calibration!!
2020-03-14_11:00:18.07347 Loaded Pilots: ['absolute', 'basic', 'simple']
2020-03-14_11:00:18.07355 warning: failed to open special file /dev/watchdog0 for writing
2020-03-14_11:00:18.07363          cannot stroke the watchdog
ICM20948 is indeed recognized ; tests indicate that driver is operational.

Thanks Sean for the advices, time, dedication and all work ; always deeply impressed !

Best,

Xavier.
Reply
#8
(2021-09-27, 09:12 AM)damien Wrote: Hello,

OK ; compilation executed and everything works fine by now.

Here follows the commands for compilation for the ones interested with tinypilot_2020_10_27.img.xz image:
Code:
# *** Compile last git version of RTIMULib2 ***
# Prepare directories, get last git and compress in .tar.gz (expected by python-RTIMULib.build)
cd ~
mkdir RTIMULib_update
cd RTIMULib_update
git clone git://github.com/seandepagnier/RTIMULib2.git
tar czvf RTIMULib2.tar.gz RTIMULib2
rm -rf RTIMULib2
# Extract, rename, compile and generate squashfs (to make persitent)
sudo sh /mnt/mmcblk0p2/tinypilot/pypilot_dependencies/python-RTIMULib/python-RTIMULib.build

# *** Reboot... ***
sudo reboot
The script python-RTIMULib.build execute the compilation and generation of the package necessary for the specific structure (RAM filesystem) of tinycore (tinypilot base) ; looking at the code is interesting.

Here is the extract of /var/log/pypilot/current:
Code:
2020-03-14_11:00:17.41751 ERROR loading intellect.py invalid syntax (intellect.py, line 205)   invalid syntax (intellect.py, line 205)
2020-03-14_11:00:17.41853 ERROR loading learning.py invalid syntax (intellect.py, line 205)   invalid syntax (intellect.py, line 205)
2020-03-14_11:00:17.67724 Settings file RTIMULib.ini loaded
2020-03-14_11:00:17.67736 Failed to open settings file for saveDetected ICM20948 at standard address
2020-03-14_11:00:17.68017 Failed to open settings file for saveUsing fusion algorithm Kalman STATE4
2020-03-14_11:00:17.68030 min/max compass calibration not in use
2020-03-14_11:00:17.68334 Using ellipsoid compass calibration
2020-03-14_11:00:17.68341 Using accel calibration
2020-03-14_11:00:18.00325 ICM-20948 init complete
2020-03-14_11:00:18.07324 loading servo calibration /home/tc/.pypilot/servocalibration
2020-03-14_11:00:18.07338 WARNING: using default servo calibration!!
2020-03-14_11:00:18.07347 Loaded Pilots: ['absolute', 'basic', 'simple']
2020-03-14_11:00:18.07355 warning: failed to open special file /dev/watchdog0 for writing
2020-03-14_11:00:18.07363          cannot stroke the watchdog
ICM20948 is indeed recognized ; tests indicate that driver is operational.

Thanks Sean for the advices, time, dedication and all work ; always deeply impressed !

Best,

Xavier.
Hello Xavier,
I have the very same problem you got as i've just received a new Pypilot hat a few days ago, I understand the git clone command works only if the raspberry is connected to the internet how do i do that please?
Reply
#9
Sorry. The hat is usually intended to work with openplotter (although it works with tinypilot) I did not realize so many intended to do this.

I am very close to releasing an update.. everything always takes longer. If you just wait a few days, I will release an image soon.
Reply
#10
Hello Sean,
I might be close to manage it, i succeeded to generate a RTIMULib2.tar.gz file on my computer using the commands given above by Xavier, however i do not know where to write it on the SD card, I tried to write it next to the RTIMULib2-old.tar.gz file and as a matter of fact the build routine (launched from the raspberry) does not find the file...or maybe it is more complex and i'd better wait for the new image release?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)