The officially official Devuan Forum!

You are not logged in.

#1 2020-11-07 16:07:41

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

[Solved] Raspberry Pi 1 Probelms

Hi,
I have some problems with Devuan on my Raspberry Pi (1 B)
and i assume that the broadcom driver /boot/bcm2708-rpi-b.dtb is not loaded correctly.
How can i check and maybe edit the boot command to make sure it is included?

The reason why i think it has to do with /boot/bcm2708-rpi-b.dtb, is because i tried to build https://github.com/pimylifeup/fm_transmitter
and it failed with this error: transmitter.cpp:36:10: fatal error: bcm_host.h: No such file or directory

and also the driverers from Adafruit_DHT (for DHT22 humidity sensor)
fail with this: RuntimeError: Error accessing GPIO.

maybe i have to edit /boot/cmdline.txt , but how to include that bcm file?

Last edited by alphalpha (2020-11-08 22:44:36)

Offline

#2 2020-11-07 16:47:59

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] Raspberry Pi 1 Probelms

alphalpha wrote:

How can i check

Try

cat /proc/cmdline

Disclaimer: I don't use Devuan on a Raspberry Pi.


Brianna Ghey — Rest In Power

Offline

#3 2020-11-07 20:28:21

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: [Solved] Raspberry Pi 1 Probelms

alphalpha wrote:

Hi,
I have some problems with Devuan on my Raspberry Pi (1 B)
and i assume that the broadcom driver /boot/bcm2708-rpi-b.dtb is not loaded correctly.
How can i check and maybe edit the boot command to make sure it is included?

hello alphalpha,

The references to cpu -> Soc:
BCM2708( armv6+fp cpu )                          - > BCM2835( Soc, including Ram, etc )
BCM2709( armv7-a cpu )                            - > BCM2836( Soc, including Ram, etc )
BCM2710( armv8-a+simd+crypto+crc cpu ) - > BCM2837( Soc, including Ram, etc )

You have rpi1B( v1.0 or v1.1? ) - > BCM2835
v1.0 - 256MB Ram
v1.1 - 512MB Ram

I assume no more differences between both..

The DTS file for rpi1 is 'bcm2835-rpi-b.dtb'

To edit the bootargs..
I usually use uboot + a boot script for headless systems..
You can check the content of the boot script I use, here
So, in that case, 'setenv bootargs earlyprintk=serial,ttyAMA0,115200n8 console=ttyAMA0,115200n8 console=tty0 root=/dev/mmcblk0p2 rw rootfstype=ext4 elevator=noop fsck.repair=yes rootwait smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 selinux=0 noinitrd'

to change it, you need to create a new boot script..
and after compile it to binary..its explained in that post smile

alphalpha wrote:

The reason why i think it has to do with /boot/bcm2708-rpi-b.dtb, is because i tried to build https://github.com/pimylifeup/fm_transmitter
and it failed with this error: transmitter.cpp:36:10: fatal error: bcm_host.h: No such file or directory

that has to do with the fact that the header file 'bcm_host.h' was not found( it could be present but the compilation process doesn't find it.. )

For what I see you will need 'bcm_host.h', because it is requested in 'transmitter.cpp:36'

36: #include <bcm_host.h>

this files are supossed to be copied to '/usr/include/'
I don't know were to find them, they are not Devuan related, but instead RaspberryPi related..

Maybe @C0rnelious can give you a hand on this?

alphalpha wrote:

and also the driverers from Adafruit_DHT (for DHT22 humidity sensor)
fail with this: RuntimeError: Error accessing GPIO.

maybe i have to edit /boot/cmdline.txt , but how to include that bcm file?

the 'bcm_host.h', and maybe others are not available in Devuan(  at least that I am aware of it.. ), they are RaspBerryPI Development Related..
I don't think you will manage to solve the problem via bootargs..

For the Humidity sensors, maybe you need a kernel module for them,
In the image available here, you only have a kernel module for 'DHT11'( maybe the kernel driver is the same?? ):

CONFIG_DHT11=m

It's a 5.4.37 mainline kernel..

EDIT: For what I saw here:
https://duckduckgo.com/?t=ffnt&q=bcm_host.h&ia=web

you will need the 'libraspberrypi-dev' package, which contains 'bcm_host.h' and others , probably needed too..

Last edited by tuxd3v (2020-11-07 21:01:03)


Best Regards,
tux

Offline

#4 2020-11-08 13:09:09

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: [Solved] Raspberry Pi 1 Probelms

Thanks a lot for your answer tux !!
it looks like libraspberrypi-dev is not in the devuan repo
i will try get it from raspbian

Offline

#5 2020-11-08 20:40:47

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: [Solved] Raspberry Pi 1 Probelms

i installed raspbian on another sd-card and did

sudo apt download libraspberrypi-dev

and got libraspberrypi-dev_1.20200819-1_armhf.deb
now when i try to install this on the devuan sd-card with

sudo dpkg -i libraspberrypi-dev_1.20200819-1_armhf.deb

it fails because dpkg: error processing archive libraspberrypi-dev_1.20200819-1_armhf.deb (--install):
package architecture (armhf) does not match system (armel)
which i find very strange, it was the same hardware, why has raspbian another architecture

also while i was on raspbian i tried the dht22 humidity sensor and it worked no problem
i debugged it with print statements and found out that it was detecting that im on a pi 3 instead of pi 1, so i had to install it from git with the --force-pi option intead of installing it with pip
so at least that is working now

Offline

#6 2020-11-08 21:05:28

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: [Solved] Raspberry Pi 1 Probelms

alphalpha wrote:

i installed raspbian on another sd-card and did

sudo apt download libraspberrypi-dev

and got libraspberrypi-dev_1.20200819-1_armhf.deb
now when i try to install this on the devuan sd-card with

sudo dpkg -i libraspberrypi-dev_1.20200819-1_armhf.deb

it fails because dpkg: error processing archive libraspberrypi-dev_1.20200819-1_armhf.deb (--install):
package architecture (armhf) does not match system (armel)
which i find very strange, it was the same hardware, why has raspbian another architecture

also while i was on raspbian i tried the dht22 humidity sensor and it worked no problem
i debugged it with print statements and found out that it was detecting that im on a pi 3 instead of pi 1, so i had to install it from git with the --force-pi option intead of installing it with pip
so at least that is working now

hello, you welcome,
in relation to the error that apears to you..
Its for historical reazons.. devuan/debian supports armv5T and armv6, for armel...

So armel doesn't have hardfloat support..

But the packages built for Raspberry PI 1B, have hardfloat support in the cpu( the cpu is the arm1176jzf-s, found in the first iphone too.. and it has hardfloat support, if memory doesn't fail me, vfpv2 ).

So long story short,
You need to install them with a "--force" flag, I believe --force-architecture

You got libraspberrypi-dev, but it has at least one dependency:
do the following:

apt-cache depends libraspberrypi-dev

Get the dependencies for it, and then install them with the "--force" flag above.

For the Humidity/Temperature sensor, do a 'lsmod',
and check which kernel module is loaded, it would be nice for us to know smile

Last edited by tuxd3v (2020-11-08 21:06:32)


Best Regards,
tux

Offline

#7 2020-11-08 22:40:47

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: [Solved] Raspberry Pi 1 Probelms

tuxd3v wrote:

For the Humidity/Temperature sensor, do a 'lsmod',
and check which kernel module is loaded, it would be nice for us to know smile

i dont see any related kernel module, it is not dht11

sudo lsmod                                                                                22:09
Module                  Size  Used by
w1_therm                6775  0
nfnetlink               7093  0
bnep                   11917  2
bluetooth             366232  7 bnep
ecdh_generic           18216  1 bluetooth
rfkill                 21483  2 bluetooth
ipv6                  401666  0
snd_bcm2835            22908  0
snd_pcm                89576  1 snd_bcm2835
snd_timer              22354  1 snd_pcm
snd                    60288  3 snd_timer,snd_bcm2835,snd_pcm
w1_gpio                 4534  0
wire                   31321  2 w1_gpio,w1_therm
cn                      5655  1 wire
hwmon                  10460  1 wire
uio_pdrv_genirq         3686  0
uio                    10016  1 uio_pdrv_genirq
fixed                   3001  0

maybe it is w1_gpio, but im not sure since i have another temperature sensor for which i loaded this

Offline

#8 2020-11-08 23:59:57

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: [Solved] Raspberry Pi 1 Probelms

hello,
yeah it shouldn't be that, I believe that is for 1wire protocol( DS18B20 and such.. )..

The DHT22, and the DHT11 I believe both use the same protocol smile
so maybe you can use it with that driver( dht11 )..

Of-course you can always go via gpio are request information on the data pin, without any driver( probably what you have smile  )..
Some sort of BitBanging the protocol via software..

its a 1 Wire protocol, it just isn't the "1Wire protocol" we know from Dallas..its different..

Does you succeed getting the 2 packages from raspbian? smile


Best Regards,
tux

Offline

#9 2020-11-09 00:32:36

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: [Solved] Raspberry Pi 1 Probelms

not really, they are installed but unconfigured
libraspberrypi-dev was depended on libraspberrypi0 and that depended on raspberrypi-bootloader
and i didnt want to install that bootloader
however i have now that /opt/vc/lib/libbcm_host.so file
but now i get more errors from make

make                                                                       23:18
g++ -L/opt/vc/lib -lm -lpthread -lbcm_host -o fm_transmitter main.o mailbox.o sample.o wave_reader.o transmitter.o
/usr/bin/ld: warning: libvchiq_arm.so, needed by /opt/vc/lib/libbcm_host.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libvcos.so, needed by /opt/vc/lib/libbcm_host.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_log_impl'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_msg_queuev'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_generic_mem_calloc'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_init'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_service_use'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_pthreads_map_errno'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_bulk_queue_transmit'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_service_open'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_msg_dequeue'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_once'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_service_close'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchiq_initialise'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_msg_queue'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchiq_queue_message'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_log_register'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_thread_join'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_log_get_default_category'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_connect'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_service_release'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_thread_create'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchiq_connect'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_create_connection'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_generic_mem_free'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_thread_attr_init'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vcos_generic_mem_alloc_aligned'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_initialise'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_bulk_queue_receive'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `single_get_func_table'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchiq_release_message'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchi_mphi_message_driver_func_table'
/usr/bin/ld: /opt/vc/lib/libbcm_host.so: undefined reference to `vchiq_open_service'

i tried to copy the /opt/vc/lib folder from https://github.com/raspberrypi/firmware … opt/vc/lib but that didn't do the trick

now i compiled the fm_transmitter on raspbian and copied it over to devuan but i can't run it
the file is there and is executable but

./fm_transmitter

  returns 'no such file or directory: ./fm_transmitter'

Offline

#10 2020-11-09 01:50:57

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: [Solved] Raspberry Pi 1 Probelms

alphalpha wrote:

not really, they are installed but unconfigured
libraspberrypi-dev was depended on libraspberrypi0 and that depended on raspberrypi-bootloader
and i didnt want to install that bootloader

but now i get more errors from make

make                                                                       23:18
g++ -L/opt/vc/lib -lm -lpthread -lbcm_host -o fm_transmitter main.o mailbox.o sample.o wave_reader.o transmitter.o
/usr/bin/ld: warning: libvchiq_arm.so, needed by /opt/vc/lib/libbcm_host.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libvcos.so, needed by /opt/vc/lib/libbcm_host.so, not found (try using -rpath or -rpath-link)

i tried to copy the /opt/vc/lib folder from https://github.com/raspberrypi/firmware … opt/vc/lib but that didn't do the trick

hello,
yeah it needed libraspberrypi-dev,libraspberrypi0..

alphalpha wrote:

and that depended on raspberrypi-bootloader

well.. that could be a problem.. sad

You need to make the Dynamic Linker aware of 'libbcm_host.so':

echo "/opt/vc/lib" >> /etc/ld.so.conf
ldconfig -vv

try to find all dependencies of 'libbcm_host.so':

ldd /opt/vc/lib/libbcm_host.so

see what is missing..

and then find what packages this files are in..

apt-get install apt-file
apt-file update

For what I saw above you have already 2 unresolved dependencies( 'libvchiq_arm.so', 'libvcos.so'  )..

apt-file search libvchiq_arm.so
apt-file search libvcos.so

See the packages were those file are.. and try to install them, if you find its safe..

alphalpha wrote:

now i compiled the fm_transmitter on raspbian and copied it over to devuan but i can't run it
the file is there and is executable but

./fm_transmitter

  returns 'no such file or directory: ./fm_transmitter'

that is another situation..

Once you get the binary compiled and running in raspbian..
You will need to copy him, and all the dependencies that are not in devuan...
I mean all those shared libraries '*.so' to devuan

and then update devuan dynamic linker so that he knows how to link your 'fm_transmitter' to those libraries( when you execute the binary )..

echo "/opt/vc/lib" >> /etc/ld.so.conf
echo "/other/path/to/so/dependency" >> /etc/ld.so.conf
ldconfig -vv

after that, you can test the binary dynamic resolution with:

ldd ./fm_transmitter

and see if all references to shared objects are all recognized..
if they are, the binary should execute

what says the command bellow? smile

file ./fm_transmitter

Last edited by tuxd3v (2020-11-09 02:02:25)


Best Regards,
tux

Offline

#11 2020-11-09 17:39:47

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: [Solved] Raspberry Pi 1 Probelms

Yes, it is working wink
turned out that copying that /opt/vc/lib folder from https://github.com/raspberrypi/firmware … opt/vc/lib was a really bad idea
'apt install --fix-broken' would always complain about the 2 armhf packages and fail removing them and sudo ldconfig would always throw a segmentation fault

luckily a made a backup before i did this
i uninstalled the armhf files from raspbian and then did this

git clone https://github.com/raspberrypi/userland.git
cd userland
sudo ./buildme

that gave me /opt/vc/lib/libbcm_host.so and all the other needed files

sudo echo "/opt/vc/lib" >> /etc/ld.so.conf
sudo ldconfig -vv

as tuxd3v mentioned

and finally

git clone https://github.com/markondej/fm_transmitter.git
cd fm_transmitter
make

thanks wink

Last edited by alphalpha (2020-11-09 17:44:46)

Offline

#12 2020-11-09 23:13:33

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: [Solved] Raspberry Pi 1 Probelms

alphalpha wrote:

Yes, it is working wink

hello alphalpha,you welcome!
Glad you succeed, kudos for you! smile

EDIT: I saw your image for x86,
And it seems nice!
Could we see that graphical environment, and great work from you in the SBC world? wink

thanks

Last edited by tuxd3v (2020-11-09 23:59:14)


Best Regards,
tux

Offline

#13 2020-11-11 23:14:52

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: [Solved] Raspberry Pi 1 Probelms

tuxd3v wrote:

[EDIT: I saw your image for x86,
And it seems nice!
Could we see that graphical environment, and great work from you in the SBC world? wink

Thanks,
that raspberry pi is running headless, i connect only via ssh and tmux, so there is no point for me to have a graphical environment installed
and now that everything is set up and deployed, i wont touch it in the near future

thanks again, i would not have been able to do this without your help wink

Offline

Board footer