epsilonrt / piduino

Arduino API on Pi boards, the best of both worlds !
https://epsilonrt.fr/2019/01/piduino/
GNU Lesser General Public License v3.0
29 stars 7 forks source link

std system error #5

Closed ghost closed 5 years ago

ghost commented 5 years ago

When executing pido or pinfo I get the following error

terminate called after throwing an instance of 'std::system_error' what(): It seems that this system is not supported !: Operation not supported Aborted

epsilonrt commented 5 years ago

Hi, This exception indicates that the automatic detection did not find the Pi board model. Could you tell me the Pi board model you use?

ghost commented 5 years ago

I use the Rpi 3 Model B

epsilonrt commented 5 years ago

Ok, can you give me the result of cat /proc/cpuinfo?

ghost commented 5 years ago

processor : 0 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 76.80 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

processor : 1 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 76.80 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

processor : 2 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 76.80 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

processor : 3 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 76.80 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

Hardware : BCM2835 Revision : 2a02082 Serial : 000000004192b6ac

ghost commented 5 years ago

Thank you very much for your fast reply.

epsilonrt commented 5 years ago

There is a problem with revision number 0x2a02082, this number is not registered on the site RPi Hardware. Could you give me the link to the page of the builder of this board ?

ghost commented 5 years ago

I dont know of any page of the builder. I purchased the Pi on amazon an year ago.

ghost commented 5 years ago

Any I have seen that my board is out of warranty when I installed wiringPi

ghost commented 5 years ago

Here is the output of gpio -v command

gpio version: 2.46 Copyright (c) 2012-2018 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty

Raspberry Pi Details: Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Sony [Out of Warranty]

epsilonrt commented 5 years ago

How did you install? from the sources?

ghost commented 5 years ago

No. From the raspbian repository

ghost commented 5 years ago

via apt-get

epsilonrt commented 5 years ago

Okay, there is an error in the revision number on the RPi Hardware website (I can not test all the boards versions !!). I would correct in the next version of the database. For the moment, I propose to modify the file /etc/piduino.conf. Remove the # from the last line to have revision=0xa02082

ghost commented 5 years ago

Ok

ghost commented 5 years ago

Thank you for your help.

ghost commented 5 years ago

And I want to control the GPIO via bluetooth using an android app. Should I need to install any other libraries or can it be done via Serial.read() ?

ghost commented 5 years ago

I previously used an app to control arduino via bluetooth serial communication. Can I use the same app to control the Pi serial ?

epsilonrt commented 5 years ago

normally pido and pinfo should work?

epsilonrt commented 5 years ago

piduino is designed so that the native arduino code works, so no problem to use the Serial object. no need for additional libraries.

epsilonrt commented 5 years ago

look at the example ASCIITable

ghost commented 5 years ago

Hi, I'm still getting the std error

epsilonrt commented 5 years ago

it should be installed in /usr/share/doc/piduino/example

ghost commented 5 years ago

I've set my revision to 2a02082 without the 0x at the start and executing pinfo, I get that the board is Raspberry Pi B instead of Raspberry Pi 3 B and pido readall showed less than 40 GPIO pins

epsilonrt commented 5 years ago

did you modify the configuration file?

ghost commented 5 years ago

Yes. I just did what you said.

ghost commented 5 years ago

I remove the # and rebooted the Pi and checked but no success

ghost commented 5 years ago

Now I set the revision to 2a02082 and executed pinfo I got the info below

Name : RaspberryPi B Family : RaspberryPi Database Id : 0 Manufacturer : Unknown Board Revision : 0x2 SoC : Bcm2708 (Broadcom) Memory : 1024MB GPIO Id : 1 PCB Revision : 1 Serial Ports : /dev/ttyAMA0

See it is showing as Raspi B instead of RPi 3B

ghost commented 5 years ago

pido readall gives me this

  P1 (#1)

+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+ | sOc | iNo | Name | Mode | V | Ph || Ph | V | Mode | Name | iNo | sOc | +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+ | | | 3.3V | | | 1 || 2 | | | 5V | | | | 0 | 30 | SDA0 | ALT0 | 0 | 3 || 4 | | | 5V | | | | 1 | 31 | SCL0 | ALT0 | 0 | 5 || 6 | | | GND | | | | 4 | 7 | GPIO4 | ALT4 | 1 | 7 || 8 | 0 | ALT4 | GPIO14 | 15 | 14 | | | | GND | | | 9 || 10 | 1 | ALT4 | GPIO15 | 16 | 15 | | 17 | 0 | RTS1 | ALT5 | 1 | 11 || 12 | 1 | ALT4 | SPI1CE0 | 1 | 18 | | 21 | 29 | GPIO21 | IN | 1 | 13 || 14 | | | GND | | | | 22 | 3 | ARMTRST | ALT4 | 1 | 15 || 16 | 0 | OUT | GPIO23 | 4 | 23 | | | | 3.3V | | | 17 || 18 | 1 | ALT4 | ARMTDO | 5 | 24 | | 10 | 12 | SPI0MOSI | ALT0 | 1 | 19 || 20 | | | GND | | | | 9 | 13 | GPIO9 | ALT2 | 1 | 21 || 22 | 1 | ALT4 | ARMTCK | 6 | 25 | | 11 | 14 | SPI0SCLK | ALT0 | 1 | 23 || 24 | 1 | ALT4 | GPIO8 | 10 | 8 | | | | GND | | | 25 || 26 | 0 | ALT5 | GPIO7 | 11 | 7 | +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+ | sOc | iNo | Name | Mode | V | Ph || Ph | V | Mode | Name | iNo | sOc | +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+

ghost commented 5 years ago

Only 26 pins instead of 40 GPIO

epsilonrt commented 5 years ago

No no ! 0x2a02082 is not in the database ! you have to leave 0xa02082, that corresponds to your board: 27|RaspberryPi 3 (0xA02082)|1024|1.2|7|3|1|1|0|0

ghost commented 5 years ago

So what is the revision I should put in the file ? Can you paste it here ?

epsilonrt commented 5 years ago

you must have revision=0xa02082 on the last line

ghost commented 5 years ago

Yeah I changed it to the above revision, but still I get the same error

ghost commented 5 years ago

here is my piduino.conf file

cat /etc/piduino.conf

PiDuino configuration file

connection_info="sqlite3:db=/usr/share/piduino/piduino.db"

Allows you to force the board tag (Armbian)

!! Be careful, this is at your own risk !!

!! Forcing an incorrect value may destroy GPIO pins !!

tag="nanopineocore"

Allows forcing the revision of the board (Raspbian)

!! Be careful, this is at your own risk !!

!! Forcing an incorrect value may destroy GPIO pins !!

revision=0xa02082

epsilonrt commented 5 years ago
# Allows forcing the revision of the board (Raspbian)
# !! Be careful, this is at your own risk !!
# !! Forcing an incorrect value may destroy GPIO pins !!
revision=0xa02082
epsilonrt commented 5 years ago

great, that's it

ghost commented 5 years ago

But still I get the error. It's not working

epsilonrt commented 5 years ago

it works ?

ghost commented 5 years ago

no.

ghost commented 5 years ago

I still get the std system error

epsilonrt commented 5 years ago

argh !

ghost commented 5 years ago

what should I do now ?

epsilonrt commented 5 years ago

can you send me the file /etc/piduino.conf by mail on epsilonrt@gmail.com?

ghost commented 5 years ago

Yop, will send it right now.

ghost commented 5 years ago

Check your inbox. I've sent the file

epsilonrt commented 5 years ago

I received ! the file is good, it should work ... I found the page with the correct revision numbers:

https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md

I will update the database and update the package, but it will not be until this afternoon because there I have no raspberry pi available ...

ghost commented 5 years ago

You mean you will update the package by the end of day ?

epsilonrt commented 5 years ago

Let me know if it works ... I warn you when the package has been updated.

ghost commented 5 years ago

Sure !

epsilonrt commented 5 years ago

exactly