Notifications
Clear all

I2C on Raspberry Pi Desktop for laptop (Mars rover robot)

Page 1 / 2

WhitneyDesignLabs
(@whitneydesignlabs)
Trusted Member
Joined: 8 months ago
Posts: 56
Topic starter  

Hi Group,

I have searched extensively and coming up blank on how to use an x86 based laptop, running Rapsberry Pi Desktop OS, and make use of an I2C bus to connect to other microcontrollers and sensors.

The main idea is to have multiple microcontrollers on the robot each handling their own task (propulsion/navigation, robot arm, sensor data, vision etc). I could use a RaspberryPi 4, or some other single board computer as the main coordinating (brain), but it seems handy to use a laptop, which could be easily upgraded to something more powerful as time went on.

The robot will be large enough to ride on by a human, making use of six wheel chair motors obtained dirt cheap from salvage yard, configured in bogey-rockerarm, with or without steering motors - undecided. Future version could could be even bigger using larger industrial 90vdc motors, also obtained from salvage yard. So space is not a big concern and using a full laptop would be handy for reasons of quick setting changes, programming the onboard micro controllers, included display etc.

My thought is to use a USB to I2c adapter like this:

https://www.ebay.com/itm/401298217576?hash=item5d6f3cda68o~IAAOSwZMNfcUJZ

But the problem is that Raspberry Pi Desktop does not appear to have any support for I2C. Am I overlooking something? The only option in Raspberry Pi Configuration GUI is to enable SSH. Same thing from command line raspi-config.  This OS is fully updated as of 8/2/2021.

How to get an I2C bus connected to a laptop? Thanks for any ideas.

BTW, if it matters, Python will be my language of choice for all devices, however using I2c, it is possible that certain microcontrollers could run C++ code.

Like: Python, Adept: C++, Don't like: Java


Quote
Will
 Will
(@will)
Reputable Member
Joined: 3 months ago
Posts: 368

ReplyQuote
Will
 Will
(@will)
Reputable Member
Joined: 3 months ago
Posts: 368

ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Trusted Member
Joined: 8 months ago
Posts: 56
Topic starter  

Thanks, Will. Finding the adapter is not the problem. The core issue is: How do I turn on I2C service in Raspberry Pi Desktop? Is it just a feature that is locked out?

Like: Python, Adept: C++, Don't like: Java


ReplyQuote
Will
 Will
(@will)
Reputable Member
Joined: 3 months ago
Posts: 368
 

@whitneydesignlabs

I haven't used the RPI very much, but I did find this article:

https://www.instructables.com/Raspberry-Pi-I2C-Python/

Does it help ?


ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Trusted Member
Joined: 8 months ago
Posts: 56
Topic starter  

Thank you. I think you may be misunderstanding the my quest/problem, which stems from using a laptop not an actual Pi.

Raspberry Pi Desktop is the Raspberry Pi operating system, Debian based Linux, that runs on a traditional computer; desktop, laptop etc.  I2C on an actual Raspberry Pi hardware single board computer, a Pi 4, for example, works fine, and is what the referenced article is about.

Here is a description of the OS I am talking about.

https://www.raspberrypi.org/software/raspberry-pi-desktop/

Debian with Raspberry Pi Desktop is our operating system for PC and Mac. It provides the Raspberry Pi OS desktop, as well as most of the recommended software that comes with Raspberry Pi OS, for any PC or Apple Mac computer.

If you have an old computer that is no longer powerful enough to run a modern commercial operating system, try Debian with Raspberry Pi Desktop: it can often make the computer usable once more.

You can install Debian with Raspberry Pi Desktop as your computer’s main operating system, run it in a virtual machine, or create a USB stick or other medium from which you can run it when required.

Like: Python, Adept: C++, Don't like: Java


ReplyQuote
MadMisha
(@madmisha)
Reputable Member
Joined: 2 years ago
Posts: 319
 

@whitneydesignlabs

Are you referring to when you are in raspi-config and in interfacing options?

 

If it is not showing up there then you would need to install the I2C kernel module but that is designed to run off of the Pi that you don't have.

 

How are you interfacing with the I2C? Do you have an external board that does that?


ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Trusted Member
Joined: 8 months ago
Posts: 56
Topic starter  

Hi MadMisha,

I have tried Preferences/Raspberry Pi Configuration and sudo raspi-config at command line. I2C shows up in neither.

I am not yet physically interfacing I2C at all. I was planning on buying a USB--I2C adapter, which are common and readily available. I even have an old one in my part's drawer from my dabblings in 8266 boards. But if I can't enable I2C in Raspberry Pi Desktop, I don't know how I will do it.

I may give up and just use a Rasberry Pi 4, as the heart of the robot. Maybe trying to use a laptop is just not the right approach.

I suppose I should also consider Jetson or other SBCs like the Hackboard2, when those start shipping.

But gosh dog it, I wanted to upcycle an older laptop. Maybe I am barking up the wrong tree.

Like: Python, Adept: C++, Don't like: Java


ReplyQuote
Will
 Will
(@will)
Reputable Member
Joined: 3 months ago
Posts: 368
 

@whitneydesignlabs

I suspect there's an RPI in your future. I'd doubt that the desktop version could emulate reading and writing to the (non-existent) pins.

What might be possible is to use the laptop to get data from the Pi, process it and send results back to the Pi over USB. That way the Pi could access sensors and motors on orders sent from the laptop and let the faster laptop CPU do the calculations.


ReplyQuote
MadMisha
(@madmisha)
Reputable Member
Joined: 2 years ago
Posts: 319
 
Posted by: @whitneydesignlabs

I have tried Preferences/Raspberry Pi Configuration and sudo raspi-config at command line. I2C shows up in neither.

You won't find anything there because those GPIO pins don't exist. Raspberry Pi Desktop is just a reskinned version of Ubuntu that looks like Raspbian(Old name but that is what it will forever be in my mind). They didn't include things like that because they knew that it wouldn't be present. Knowing this, you might rethink the Linux distro you are using. But if you are comfortable with it, I'm sure it will work for you.

 

I would start with whatever interface you decide on using and just follow the documentation on that as to how to access it. If you have the right drivers/library, it shouldn't matter. Raspbian was using that as a way to secure their hardware but since you will be using your own, that shouldn't affect you.


ReplyQuote
THRandell
(@thrandell)
Eminent Member
Joined: 4 months ago
Posts: 23
 

Hi @whitneydesignlabs

I don't mean to de-rail your thread, but your description of using a bogey rockerarm suspension reminded me of the Reddit Robotics Showcase last weekend.  The topic in question was “ExoMy – The 3D Printed Open Source Rover” https://esa-prl.github.io/ExoMy/   Have you seen this one?  All of their software stack is open source (ROS, Docker running ubuntu running on a Raspberry Pi).  Maybe you can leverage some of their software.

 


ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Trusted Member
Joined: 8 months ago
Posts: 56
Topic starter  

@will yes, I have a Rpi4 and a Pi3A+, so I will probably just use one of those, or maybe get a Rpi400, and add a nice big screen, and mini wireless mouse/keyboard. I am dropping the laptop idea for now.

 

Like: Python, Adept: C++, Don't like: Java


ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Trusted Member
Joined: 8 months ago
Posts: 56
Topic starter  

@madmisha Understood. I thought maybe the USB-I2C adapter would basically "emulate" physical pins. But the Raspberry Pi Desktop OS doesn't seem to have a way to send I2C data over USB.

I think I will just use an actual Raspberry Pi for the brain of the robot's main computing platform. So I am dropping my quest for a laptop that is I2C-capable and runs Raspberry Pi OS.

Maybe later the whole thing will migrate to a high power Jetson or something.

Like: Python, Adept: C++, Don't like: Java


ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Trusted Member
Joined: 8 months ago
Posts: 56
Topic starter  
Posted by: @thrandell

I don't mean to de-rail your thread, but your description of using a bogey rockerarm suspension reminded me of the Reddit Robotics Showcase last weekend.  The topic in question was “ExoMy – The 3D Printed Open Source Rover” https://esa-prl.github.io/ExoMy/   Have you seen this one?  All of their software stack is open source (ROS, Docker running ubuntu running on a Raspberry Pi).  Maybe you can leverage some of their software.

No worries. The thread had run its course, and I have dropped the design approach referenced in the original post/question.

I will check the Rover project out. For continued discussion about Rocker/Bogie designs, let's take it up in another thread. I am actively working on my design in Solidworks right now. Based on 1" round tubing attaching to six wheelchair motors and airless wheelchair wheels.

Like: Python, Adept: C++, Don't like: Java


ReplyQuote
MadMisha
(@madmisha)
Reputable Member
Joined: 2 years ago
Posts: 319
 
Posted by: @whitneydesignlabs

I thought maybe the USB-I2C adapter would basically "emulate" physical pins. But the Raspberry Pi Desktop OS doesn't seem to have a way to send I2C data over USB.

If you have the adapter, PI desktop OS will still run I2C over USB. Any Linux distro will. As in, if you plug in the adapter over USB you will be able to control it and output/input the I2C. But even with a Pi, you couldn't really emulate it. You would be actually sending out those signals through those pins.

The only reason you are able to turn off the I2C function on a Pi is for security reasons but even if that is not present, you can still use I2C. It only affects their hardware and will not affect any hardware you install.

Unfortunately, there is a lot of confusion out there as to what the desktop OS does. It does not emulate a Pi at all. It just gives you an OS that runs on a computer that looks like the OS on a Raspberry Pi and is based off the same distro as the Pi. Honestly, I think that most people are better off running Ubuntu or Mint instead.

 

If you are still wanting to have a processor that is faster than a Pi, a laptop would be a good option. It is still possible.


ReplyQuote
Page 1 / 2