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
IMU connected to a Laptop?
#1
Hey guys,

I'm wondering if I should switch from my RPi to an old laptop to run OpenPlotter with OpenCPN for performance reasons in OpenCPN. It's purely aesthetics but I'd like to have a smooth experience for the chart plotter.

The only reason I can see why this would be slightly more complex than with the rpi is the IMU.

Any established, known working way of connecting an MPU9250 to a laptop such that it works as easily as with the PI?
https://sailoog.gitbooks.io/openplotter-...mpass.html

Cheers,
Timo
Reply
#2
i looked into it but never tested anything do a google search and you will find a device "Bus Pirate" and some i2c hacks to memory module's and vga connections even then i don't know if it would be compatible

https://github.com/rkamath13/i2c-sensor-laptop-access

https://www.google.com/search?safe=off&e...4UQ4dUDCAs
Reply
#3
you could just use the laptop to run opencpn I have done that in the past. There are windows and Linux versions. you just point the connection to the rpi
Reply
#4
what ddelorme said would be the easiest way...let the pi handle the sensors and send the data to the laptop running opencpn..
Reply
#5
I finally see this... Thanks for the answers! I think running the Pi as a sensor server makes a lot of sense! Thank you!
Reply
#6
I’m looking into this again, today. I have a breakout board for the VGA port and the sensor ready. I need to hook up the four wires but I can already scan the i2c ports using i2cdetect.
In the openplotter setup it says i2c sensors can only be installed on Pi. However, technically there should be no difference in HOW to access existing ports on Pi or Ubuntu Laptop.

Can someone point me to the i2c sensor daemon / server repo? I would like to check if I can just compile and start this given proper udev rules (that I still need to understand).

If nothing works, I’ll try to use tinypilot and an old Raspberry Pi 1
Reply
#7
Generally, this totally works. I hooked up the IMU to the VGA port using it's VIN 5V compatible power in and SDA/SCL directly to the pins. The IMU shows up on I2C-1:

chartplotter@chartplotter-Satellite-U505:~$ sudo 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: -- -- -- -- -- -- 76 --
chartplotter@chartplotter-Satellite-U505:~$ sudo i2cdump -y 1 0x68
No size specified (using byte-data access)
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: c2 d2 e3 f0 ab de 29 c0 08 29 04 03 00 69 61 70    ??????)??)??.iap
10: c7 ba ec 00 00 00 00 00 00 00 00 00 00 00 00 00    ???.............
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30: 00 00 00 00 00 00 00 00 00 00 05 3d c0 f2 04 0b    ..........?=????
40: a8 0e b0 fd b0 00 52 ff e2 00 00 00 00 00 00 00    ?????.R.?.......
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 01 00 00 00 00 00 00 00 00 01 00 00 00 ea    ..?........?...?
70: 00 00 00 00 00 75 00 e1 b6 00 ea 10 00 27 da 00    .....u.??.??.'?.
80: c2 d2 e3 f0 ab de 29 c0 08 29 04 03 00 69 61 70    ??????)??)??.iap
90: c7 ba ec 00 00 00 00 00 00 00 00 00 00 00 00 00    ???.............
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
b0: 00 00 00 00 00 00 00 00 00 00 01 3d b0 f3 48 0b    ..........?=??H?
c0: 3c 0e 90 fd d0 00 83 ff dc 00 00 00 00 00 00 00    <????.?.?.......
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 03 b4    ...........?..??
f0: 00 00 00 00 00 75 00 e1 b6 00 ea 10 00 27 da 00    .....u.??.??.'?.

Now with this already working just like that, I see no real reason to not just start the sensors server and hook it up.
Reply
#8
I followed https://github.com/pypilot/pypilot to compile and install pypilot successfully.
Now I tried getting the IMU to work again but so far without success. It seems like pypilot_boatimu is using a config file it creates in the user's home directory called RTIMULib.ini
In there we can find a number of config options like whether to use I2C or SPI for communication. I hooked my sensor up to I2C but the output of pypilot_boatimu suggests that it is ignoring that setting and is instead looking for SPI-0, Select 0 instead.
I changed things in the config file and none of my settings are respected at the moment. However, it does look like pypilot can connect when the server is running and I start the UI from within OpenCPN. So there is a way, I just need the IMU sensor to come up.


chartplotter@chartplotter-Satellite-U505:~$ pypilot_boatimu
imu process 22259
pypilotServer process 22261
server setup has 3 pipes
[sudo] password for chartplotter: zeroconf addresses ['192.168.1.52', '127.0.0.1'] 2
zeroconf exception:

made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Failed to open SPI bus 0, select 0
Using fusion algorithm Kalman STATE4
ERROR: No IMU Detected 1158.533589643
imu rate set to rate 20
setting initial gyro bias [0.0, 0.0, 0.0]
calibration loaded, starting 22257
Reply
#9
Okey what a battle. IT WORKS!

Long story short: I had the wrong IMU plugged in. PyPilot doesn not like a fake GY-91 for whatever reason but the MPU92.65 works and fires right up when connected to my laptop's mainboard's VGA port through a simple breakout board!

That is, it does that as long as there is no RTL-SDR plugged in during boot. For reasons I fail to understand, Ubuntu messes around with the i2c assignments when the RTL dongle is connected during boot. This is highly annoying and I need to understand why. Any ideas anyone?

To make this work, I pulled the latest pypilot (which is only supposed to work on Raspberry Pi), compiled and installed it. Then I start it as a service after renaming the username in the service file that's installed. I also added "ExecStartPre=/bin/sleep 30" to the [Service] section to let all the serial ports come up before PyPilot makes an attempt to probe them.
Then I just plug everything in. GPS gets an assignment in Serial and then added to SignalK. PyPilot gets no assignment. I added one single connection to OpenCPN which is port 3000 to SignalK.
Reply
#10
I was seemingly able to solve this by blacklisting RTL-SDR relevant modules during boot by following this guide:
https://sdr-enthusiasts.gitbook.io/ads-b...el-modules

After I completed all steps, I am now able to reboot with everything plugged in and it appears to work. I'll reboot a few times to confirm but so far so good!

EDIT: I rebooted quite a few more times and everything comes up and works as expected. The one thing I still need to do every single time is in the PyPilot plugin for OpenCPN, click on Config, click on OK, and then it connects. I don't know why it would not automatically use the last known settings and make a connection attempt. Especially because I'm not even changing anything. I really just hit okey and it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)