How to.... interface the RPi with spirit board

The more technical aspects of Spirit, and carry-over discussion from Kickstarter updates.
mgodiya
Posts: 5
Joined: Tue Oct 31, 2017 3:45 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

How to.... interface the RPi with spirit board

Postby mgodiya » Mon Nov 27, 2017 1:26 am


Kevin
Posts: 180
Joined: Tue Jul 28, 2015 12:56 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to.... interface the RPi with spirit board

Postby Kevin » Tue Nov 28, 2017 1:28 am

As soon as we finish shipping I'll have a proper guide with a library for the Pi so everyone can start to really play with this. Thanks for sharing!!

-Kevin

odinshen
Posts: 3
Joined: Sat Oct 14, 2017 5:40 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to.... interface the RPi with spirit board

Postby odinshen » Sun Dec 03, 2017 2:39 pm

Thanks for your share, mgodiya

I had tried today, sometime I can send buzzer command from Python, but more of time I saw IOError message during the 1st I2C command, have you saw that also? Any idea?

Traceback (most recent call last):
File "sr_python_test.py", line 49, in <module>
writeByte(serv_values[x%3],reg_serv_values[x%3])
File "sr_python_test.py", line 17, in writeByte
bus.write_byte_data(address,reg_val,value)
IOError: [Errno 121] Remote I/O error

Kevin
Posts: 180
Joined: Tue Jul 28, 2015 12:56 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to.... interface the RPi with spirit board

Postby Kevin » Tue Dec 05, 2017 2:35 am

The Pi's I2C hardware has some bugs. This is apparently related to the chip used on the Pi and it caused all kinds of problems and hassles getting things to work correctly. For most of the Pi to Pic I2C communications, we need to add a slight delay (I think it's a few microseconds if I remember correctly) before the PIC responds back. There is a function in the library we wrote to deal with this and only needs to be called once. This together with the rest of the pre-written functions in our Python library makes all the coms real easy. I'm going to get that posted with some instructions soon. Almost done shipping these guys. That's the big focus right now then we'll have the Pi stuff posted. Hang in there. It should work smoothly once that's posted.

Thanks!
-Kevin

mgodiya
Posts: 5
Joined: Tue Oct 31, 2017 3:45 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to.... interface the RPi with spirit board

Postby mgodiya » Wed Dec 06, 2017 12:50 am

Thanks for the details Kevin, we are patiently waiting for your python library.
Meanwhile odinshen, you could try the following to make the above script work.
1. Make sure you are following the steps above correctly despite my poor formatting :)
2. Make sure I2C and SPI are enabled on the Pi
3. As Kevin mentioned, try uncommenting the 3 lines in the script (it will give the pi more time to respond)

let me know how you make out.
Sorry for the late reply.

PS:I am pretty sure your problem can be solved using 1st or/and 2nd solutions.

User avatar
Astroghost
Posts: 9
Joined: Tue Oct 24, 2017 10:35 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to.... interface the RPi with spirit board

Postby Astroghost » Thu Dec 14, 2017 11:33 am

Hi all,
Have a special robotic day in ower Fablab tomorrow , , i was expecting that we get all information from Kevin to control the robot by BLE and remote controller , but nothing come at this day.
Bad news that i would not be able to present the spirit rover :cry:

Do someone know how to send data to serial via BLE , i've actually programmed the HC-06 BLE module to work at 57600 and connecting it with my smartphone , but spirit rover don"t received the command i send.
BERNIER François
FabLab Manager at L.A.B. Aix en Provence -FRANCE
http://astronomie-astrophotographie.fr

User avatar
esba1ley
Posts: 58
Joined: Sun Jan 01, 2017 2:15 am
Location: Pasadena, CA
Contact:

Re: How to.... interface the RPi with spirit board

Postby esba1ley » Mon Jan 22, 2018 3:41 am

Does anyone have a list of what's available at what addresses on the i2c in addition to what was in the python test code above? A handy reference would be nice...
----------
Erik S. Bailey
Entry, Descent, and Landing Aerospace Engineer
Maker, and Musician
SpiritRover Kickstarter Backer #460

User avatar
esba1ley
Posts: 58
Joined: Sun Jan 01, 2017 2:15 am
Location: Pasadena, CA
Contact:

Re: How to.... interface the RPi with spirit board

Postby esba1ley » Sun Jan 28, 2018 6:09 am

Also, what frequency is the i2c bus running at? It seems to be higher than 100kHz based on what I'm seeing with pigpiod and piscope, which can only sample the gpio at 1 microsecond... I'm also seeing 20Hz activity on the I2C pins (2 and 3) on the RasPI...
----------
Erik S. Bailey
Entry, Descent, and Landing Aerospace Engineer
Maker, and Musician
SpiritRover Kickstarter Backer #460

User avatar
esba1ley
Posts: 58
Joined: Sun Jan 01, 2017 2:15 am
Location: Pasadena, CA
Contact:

Re: How to.... interface the RPi with spirit board

Postby esba1ley » Mon Jan 29, 2018 8:34 am

----------
Erik S. Bailey
Entry, Descent, and Landing Aerospace Engineer
Maker, and Musician
SpiritRover Kickstarter Backer #460

gpvillamil
Posts: 75
Joined: Fri Jan 26, 2018 5:03 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to.... interface the RPi with spirit board

Postby gpvillamil » Wed Jan 31, 2018 6:54 pm

This is very cool. So you're using I2C to talk directly to the PIC processor?

I was poking around the Arduino sketch, and it looks like you can probably use SPI to go from the Pi to the Arduino, and then use the existing Arduino libraries. You could probably do all the code for easing/simultaneous moves on the Arduino, I think.

It looks like the missing piece of the puzzle is just some libraries on the Pi side to send commands over SPI.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 1 guest