Page 1 of 1

Installing the Python libraries & demos

PostPosted: Fri Nov 28, 2014 2:32 pm
by mikronauts
Russel emailed me asking how to install the Python libaries... I thought others might find my response to Russel helpful:

Hi Russel,

I'll add more installation instructions in the next version of the User Manual :-)

For now:

1. open an ssh session (or local terminal) on the Pi

2. wget http://www.mikronauts.com/wp-content/up ... -Demos.zip

3. unzip RoboPi-Libs-and-Demos.zip

4. cd RoboPy2.7

5. cp ../Python_Demos/* .

You can now execute any of the Python demos by typing the name of the example

./digitalRead.py

...

If you have not already done so, please follow the instructions on p.9 of the User Manual to make the serial port available to RoboPi

Re: Installing the Python libraries & demos

PostPosted: Wed Dec 03, 2014 11:40 pm
by dpye_bc
Part of Russell's trouble was that he didn't have internet access on the Raspberry Pi.
Now that we've got that sorted, we were able to follow your steps (including pg.9 of the manual).
However, when we try to run the Python demos, we get the following error:
Code: Select all
ImportError: /home/pi/Python_Demos/_RoboPiLib.so: undefined symbol: PyClass_Type

Any suggestions what to do next?

Re: Installing the Python libraries & demos

PostPosted: Thu Dec 04, 2014 1:00 am
by dpye_bc
I'm not sure what we did to get rid of that error, but it stopped... possibly running IDLE3 from LXTerminal as "sudo IDLE3" helped... not sure...
Anyway, now the demos run, after putting parentheses in the print commands to get rid of that syntax error.
However, they hang every time the RoboPi is addressed, whether it's a read or write command.

Did some sanity checking by splitting the print command into two lines (in the analogRead demo) - one for the adc counter and one for the RoboPi value.
The code runs, prints a "0" and then hangs...
If we comment out the second print command, the code spits out 0 to 7 a hundred times just fine.

We tried all the demos and none worked. We probably have something hooked up wrong, but there's no illustrations with the demos to check against.

Overall, not a very satisfying endeavour... yet!

Re: Installing the Python libraries & demos

PostPosted: Thu Dec 04, 2014 11:05 am
by mikronauts
Sorry to hear about the issues you are having!

The ImportError is usually caused by trying to import the wrong version of the Python library.

RoboPi-Libs-and-Demos.zip has "RoboPy2.7" and "RoboPy3.2" versions of the libraries included.

If you are running IDLE3, you need the RoboPy3.2 libraries to run the demos.

I'd suggest you copy the files appropriate version into the Python_Demos directory.

The Python code hanging is usually caused by one of:

1) /dev/ttyAMA0 is still being used for a serial console

As you have followed the instructions on p.9 this is likely not the cause

2) firmware is not loaded into RoboPi

I am quite sure that I loaded the firmware and tested the board before I sent the board to Tim

3) wrong version of firmware present in RoboPi

This is quite possible, as I sent the board to Tim quite some time ago

I will be adding a "How to load the RoboPi firmware onto RoboPi" section to the manual, until then, here is how you should be able to load it:

1) download the latest released EEPROM image from

http://www.mikronauts.com/wp-content/up ... _v0.81.zip

unzip it into a "firmware" directory

2) download the propeller loader used to program RoboPi

http://www.mikronauts.com/wp-content/up ... -rpi-3.zip

rename "RoboPi v0.81.eeprom" to RoboPi.eeprom using the file manager

unzip it into the firmware, and make sure it is an executable ("chmod +x propeller_load" if necessary)

3) To program the firmware into RoboPi:

sudo ./propeller-load -e RoboPi.eeprom -r

If that does not work, then I have uploaded a newer propeller load to my site, for which the command is

sudo ./propeller-load -p /dev/ttyAMA0 -Dreset=gpio,17,0 -r RoboPi.eeprom

Let me know how it goes...

Best Regards,

Bill

Re: Installing the Python libraries & demos

PostPosted: Tue Dec 09, 2014 12:41 pm
by mikronauts
Update: (via email)

Apparently Raspbian was re-installed, however it is not clear that the serial console was disabled after re-installation (p.9 of user manual)

I am waiting to hear if disabling the serial console, or the suggestions above, got the demos running.

I've decided all future full kits will be shipped with the latest firmware programmed into the EEPROM :-)

Re: Installing the Python libraries & demos

PostPosted: Mon Jan 12, 2015 2:50 pm
by DarkGoat
Hi All
Nice to be here. I just finished building the RoboPi and im trying to install it.
I have followed P9 of user manual but when i open the cmdline.text file the only thing i get is:-

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1
root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait

This is the only line in the editor, so currently im stuck.
Any advice, please remember im a total noob. ohh LED2 is on and red.

Re: Installing the Python libraries & demos

PostPosted: Mon Jan 12, 2015 3:09 pm
by DarkGoat
Ohh and im using model B+

Re: Installing the Python libraries & demos

PostPosted: Thu Jan 15, 2015 4:07 pm
by mikronauts
Welcome!

Change the line in cmdline.txt to read:

dwc_otg.lpm_enable=0 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait


(ie remove 'console=ttyAMA0,115200 console=tty1')

You also need to put a '#' character at the start of the line in /etc/inittab that reads

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

If you cannot find an exact match, comment out (add the '#' as the first character) any line that has 'ttyAMA0' in it.

Let me know how it goes!

DarkGoat wrote:Hi All
Nice to be here. I just finished building the RoboPi and im trying to install it.
I have followed P9 of user manual but when i open the cmdline.text file the only thing i get is:-

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1
root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait

This is the only line in the editor, so currently im stuck.
Any advice, please remember im a total noob. ohh LED2 is on and red.

Re: Installing the Python libraries & demos

PostPosted: Wed Feb 18, 2015 6:32 pm
by DarkGoat
Im sorry i did not get back sooner.
All problems have been corrected. I could not use Joe to edit instead i used file manager to find the cmdline and edited after that.
I also had to use piconfig ( i think is the name ) to stop the serial link.
All worked as it should.
I have now tested the card fully and everything is working as it should be.
Off course now I have more questions but not on this subject. I will start a new post.

Re: Installing the Python libraries & demos

PostPosted: Wed Feb 18, 2015 8:10 pm
by mikronauts
Glad to hear it all works!

DarkGoat wrote:Im sorry i did not get back sooner.
All problems have been corrected. I could not use Joe to edit instead i used file manager to find the cmdline and edited after that.
I also had to use piconfig ( i think is the name ) to stop the serial link.
All worked as it should.
I have now tested the card fully and everything is working as it should be.
Off course now I have more questions but not on this subject. I will start a new post.