alidaf / raspberryPi

Raspberry Pi specific projects.
GNU General Public License v2.0
28 stars 8 forks source link

piRotEnc error: Unable to determine hardware version. I see: Hardware : BCM2835 #2

Closed lonehelmet closed 7 years ago

lonehelmet commented 7 years ago

Hi @alidaf,

I have been using your piRotEnc to control the volume on my Pi Musicbox 0.6.0 installation (https://github.com/pimusicbox/pimusicbox). It has been working great until now.

But now I have upgraded to Pi Musicbox 0.7.0 RC4 and I get the following error when I run piRotEnc:

Unable to determine hardware version. I see: Hardware  : BCM2835
expecting BCM2708 or BCM2709

This is probably due to some newer drivers in Pi Musicbox 0.7.0, which present the audio device as BCM2835 instead of BCM2708 or BCM2709 like it used to be.

I'm not sure how to fix this. Could you please advice?

Thanks

alidaf commented 7 years ago

Wow, somebody actually uses it!

I don't have any knowledge of Pi Musicbox and I haven't been very active with piRotEnc for a long time but I'll try and have a look for you. Just don't expect anything immediately. I'll need to refresh my memory and get back into the groove of rPi programming. I've been focussed on Arduino stuff lately!

Based on what you have told me, I don't immediately think the issue is with the piRotEnc driver itself, but it may have something to do with the dependencies. Did you compile it yourself or did you use a binary file?

Regards

Darren

Hi @alidaf https://github.com/alidaf,

I have been using your piRotEnc to control the volume on my Pi Musicbox 0.6.0 installation (https://github.com/pimusicbox/pimusicbox). It has been working great until now.

But now I have upgraded to Pi Musicbox 0.7.0 RC4 and I get the following error when I run piRotEnc:

|Unable to determine hardware version. I see: Hardware : BCM2835 expecting BCM2708 or BCM2709 |

This is probably due to some newer drivers in Pi Musicbox 0.7.0, which present the audio device as BCM2835 instead of BCM2708 or BCM2709 like it used to be.

I'm not sure how to fix this. Could you please advice?

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alidaf/raspberryPi/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhwwB6nKO5fPEg4Q7NT1nkXgKzUYnWuks5rrka7gaJpZM4Mwego.

alidaf commented 7 years ago

Could you also tell me what version of the rPi you are using.

On 01/04/17 13:44, lonehelmet wrote:

Hi @alidaf https://github.com/alidaf,

I have been using your piRotEnc to control the volume on my Pi Musicbox 0.6.0 installation (https://github.com/pimusicbox/pimusicbox). It has been working great until now.

But now I have upgraded to Pi Musicbox 0.7.0 RC4 and I get the following error when I run piRotEnc:

|Unable to determine hardware version. I see: Hardware : BCM2835 expecting BCM2708 or BCM2709 |

This is probably due to some newer drivers in Pi Musicbox 0.7.0, which present the audio device as BCM2835 instead of BCM2708 or BCM2709 like it used to be.

I'm not sure how to fix this. Could you please advice?

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alidaf/raspberryPi/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhwwB6nKO5fPEg4Q7NT1nkXgKzUYnWuks5rrka7gaJpZM4Mwego.

lonehelmet commented 7 years ago

Thanks for your response! Yes I have been using it and it has been working great for a long time, so thank you :). I'm using it on a Raspberry Pi Zero (the old one, without wifi).

I compiled piRotEnc using this command: gcc piRotEnc.c alsaPi.c rotencPi.c -o piRotEnc -lwiringPi -lasound -lm -lpthread -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -pipe -O3

Great if you could have a look, no hurry!

alidaf commented 7 years ago

Have you always used the zero or have you recently moved to the zero from a Pi 2?

I'm just wondering whether the compiler flags are to blame. I have a zero but I've not used it yet. You could try leaving out some of the compiler options as a workaround. They are optimisations that are specific to the chip, which is different on some of the Pis.

Try leaving out the -mtune and -march options.

If that works then I just need to find the correct optimisations for the zero, and also for the rPi3. I wrote that code before either of those versions came out!

If it still doesn't work then I'll need to have a look at some of the other libraries.

Whether it works or it doesn't, please let me know. I'm a bit tied up for a few days but I'll certainly aim to get this working for you as soon as I can.

Regards

Darren

On 01/04/17 14:06, lonehelmet wrote:

Thanks for your response! Yes I have been using it and it has been working great for a long time, so thank you :). I'm using it on a Raspberry Pi Zero (the old one, without wifi).

I compiled piRotEnc using this command: |gcc piRotEnc.c alsaPi.c rotencPi.c -o piRotEnc -lwiringPi -lasound -lm -lpthread -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -pipe -O3|

Great if you could have a look, no hurry!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alidaf/raspberryPi/issues/2#issuecomment-290918986, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhwwAMBXJ6KuBJSKlPTcLvwzPEZhAmpks5rrkvWgaJpZM4Mwego.

lonehelmet commented 7 years ago

Hi Darren,

I have always used the same Pi Zero to compile and run the software on. I'll try to compile again without the compiler option you mentioned. But I don't think that will make a difference, see below.

I think the cause of the problem is in the new Pi firmware that comes with the new Pi MusicBox image. The new image is based on Raspian Wheezy.

I just did a cat /proc/cpuinfo on the same Pi Zero while having loaded the 2 different images. The image (0.6.0) on which piRotEnc is working well gave this result:

Hardware : BCM2708
Revision : 900093

But the new image (0.7.0) on which piRotEnc does not work gave this result:

Hardware : BCM2835
Revision : 900093

So the new firmware just identifies the CPU differently (BCM2835).

alidaf commented 7 years ago

Thanks for that info. I was going to ask you for it at some point.

I found this info on differences reported by the kernel...

http://raspberrypi.stackexchange.com/questions/840/why-is-the-cpu-sometimes-referred-to-as-bcm2708-sometimes-bcm2835

I'm guessing one of the low level libraries, such as wiringPi, is the source of the problem. I don't particularly like it and moved to pigpio with some more recent projects. My code is high level and is agnostic regarding the hardware but wiringPi is low level driver for the digital pins.

Nevertheless, I'll look into it but may not be able to do much until the start of next week. I'll let you know if I figure something out.

On 01/04/17 17:27, lonehelmet wrote:

Hi Darren,

I have always used the same Pi Zero to compile and run the software on. I'll try to compile again without the compiler option you mentioned. But I don't think that will make a difference, see below.

I think the cause of the problem is in the new Pi firmware that comes with the new Pi MusicBox image. The new image is based on Raspian Wheezy.

I just did a |cat /proc/cpuinfo| on the same Pi Zero while having loaded the 2 different images. The image (0.6.0) on which piRotEnc is working well gave this result:

|Hardware : BCM2708 Revision : 900093 |

But the new image (0.7.0) on which piRotEnc does not work gave this result:

|Hardware : BCM2835 Revision : 900093 |

So the new firmware just identifies the CPU differently (BCM2835).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alidaf/raspberryPi/issues/2#issuecomment-290930668, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhwwOAt93a3h6lkTcVqhE3igk8sKkjvks5rrnrugaJpZM4Mwego.

alidaf commented 7 years ago

Hi,

I've done some detective work and that error definitely comes from wiringPi. I think it was fixed in version 2.40 but the latest version is 2.44. The newer kernels report the hardware a little differently and now report BCM2835. You can download and install wiringPi yourself if the repo for MusicBox isn't up-to-date. Instructions are here...

http://wiringpi.com/download-and-install/

Have a go but if you are still having problems then let me know. Let me know if it works so I can close the ticket.

I'm also interested in your project and would appreciate some pictures of what you've done if you've built any nice custom case for it. I could post them into a wiki to show off what you have built if you don't mind.

Would you believe that I haven't even got around to using my own code yet! I'm stuck in development hell trying to get the OLED display working for mine.

Regards

Darren

On 01/04/17 17:27, lonehelmet wrote:

Hi Darren,

I have always used the same Pi Zero to compile and run the software on. I'll try to compile again without the compiler option you mentioned. But I don't think that will make a difference, see below.

I think the cause of the problem is in the new Pi firmware that comes with the new Pi MusicBox image. The new image is based on Raspian Wheezy.

I just did a |cat /proc/cpuinfo| on the same Pi Zero while having loaded the 2 different images. The image (0.6.0) on which piRotEnc is working well gave this result:

|Hardware : BCM2708 Revision : 900093 |

But the new image (0.7.0) on which piRotEnc does not work gave this result:

|Hardware : BCM2835 Revision : 900093 |

So the new firmware just identifies the CPU differently (BCM2835).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alidaf/raspberryPi/issues/2#issuecomment-290930668, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhwwOAt93a3h6lkTcVqhE3igk8sKkjvks5rrnrugaJpZM4Mwego.

lonehelmet commented 7 years ago

Thanks Darren, you have solved the issue! Installing the latest WiringPi from its own repository and then compiling piRotEnc did the trick and piRotEnc is working great once again.

Here are some pictures of my project. I didn't create a custom case but re-used the case of a broken Philips BX580A radio from around 1949. The leftmost dial is connected to a rotary encoder which is then connected to the GPIO pins of my Pi Zero. This is where piRotEnc comes in to change the volume up and down. The Pi Zero uses a PlainAMP amplifier for digital-to-analogue sound output.

bx580a-front bx580a-inside

I'll add another picture later, where you can see piRotEnc in action. I'm quite happy with the results. I'm planning to add a second rotary encoder at some point to be able to switch internet radio stations using one of the other dials.

By the way, I was referred to your piRotEnc project by the manufacturer of the PlainAMP (PolyVection). They helped me install and configure it the first time.

Thanks again and I hope you get your LCD issue sorted :)

alidaf commented 7 years ago

Wow! I'm down to the charity shops all the time looking for vintage stuff to do something like this with. Nothing yet but that looks awesome.

I look forward to seeing more in the future but I'll close the ticket in the meantime.

Regards

Darren

On 03/04/17 20:32, lonehelmet wrote:

Thanks Darren, you have solved the issue! Installing the latest WiringPi from its own repository and then compiling piRotEnc did the trick and piRotEnc is working great once again.

Here are some pictures of my project. I didn't create a custom case but re-used the case of a broken Philips BX580A radio from around 1949. The leftmost dial is connected to a rotary encoder which is then connected to the GPIO pins of my Pi Zero. This is where piRotEnc comes in to change the volume up and down. The Pi Zero uses a PlainAMP amplifier for digital-to-analogue sound output.

bx580a-front https://cloud.githubusercontent.com/assets/8754913/24627188/356c83c0-18b4-11e7-8a67-d044d50a7a4e.jpg bx580a-inside https://cloud.githubusercontent.com/assets/8754913/24627187/3567ee50-18b4-11e7-8bff-e500918a33bd.jpg

I'll add another picture later, where you can see piRotEnc in action. I'm quite happy with the results. I'm planning to add a second rotary encoder at some point to be able to switch internet radio stations using one of the other dials.

By the way, I was referred to your piRotEnc project by the manufacturer of the PlainAMP (PolyVection). They helped me install and configure it the first time.

Thanks again and I hope you get your LCD issue sorted :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alidaf/raspberryPi/issues/2#issuecomment-291249087, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhwwDON3gwbT7QLlVmHgCMbVqR3Vvtiks5rsUlGgaJpZM4Mwego.