Ideetron / Larank

Software for the Larank product range.
GNU General Public License v3.0
15 stars 12 forks source link

upgraded to 4.4 - no SPI devices #13

Closed dennisg closed 7 years ago

dennisg commented 7 years ago

Hi,

So to be able to use the latest and greatest version of the lorank8 software, I upgraded my lorank8 beagleboard from 3.8.x to 4.4.39-bone15.

I then also updated the lorank software to 0.2.4 but alas, I ended up with a non-functional gateway. I seem to be narrowing down the problems to the fact that somewhere during the update SPI support was dropped... i.e. no /dev/spidev* devices available. ./poly_pkt_fwd errors out with a ERROR: [main] failed to start the concentrator

Can you help me enabling SPI support again ?

relevant part (I think) of /boot/uEnv.txt:

#cape_enable=capemgr.enable_partno=BB-UART2

##SPI0
cape_enable=capemgr.enable_partno=BB-SPIDEV0

##Disable HDMI
cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

thanks

barthiddink commented 7 years ago

Hi, Most of the SPI  trouble can be solved with a simple restart of the Lorank.  Met vriendelijke groet, Best regards, Bart HiddinkCEO+31(0) 6 18213534 Ideetron b.v. Dorpsstraat 81, 3941JL, Doorn, The NetherlandsKvk:54371996 -------- Oorspronkelijk bericht --------Van: Dennis Geurts notifications@github.com Datum: 28-12-16 17:16 (GMT+01:00) Aan: Ideetron/Lorank Lorank@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Onderwerp: [Ideetron/Lorank] upgraded to 4.4 - no SPI devices (#13) Hi, So to be able to use the latest and greatest version of the lorank8 software, I upgraded my lorank8 beagleboard from 3.8.x to 4.4.39-bone15. I then also updated the lorank software to 0.2.4 but alas, I ended up with a non-functional gateway.

I seem to be narrowing down the problems to the fact that somewhere during the update SPI support was dropped... i.e. no /dev/spidev* devices available. ./poly_pkt_fwd errors out with a ERROR: [main] failed to start the concentrator Can you help me enabling SPI support again ? relevant part (I think) of /boot/uEnv.txt:

cape_enable=capemgr.enable_partno=BB-UART2

SPI0

cape_enable=capemgr.enable_partno=BB-SPIDEV0

Disable HDMI

cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/Ideetron/Lorank","title":"Ideetron/Lorank","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/Ideetron/Lorank"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"upgraded to 4.4 - no SPI devices (#13)"}],"action":{"name":"View Issue","url":"https://github.com/Ideetron/Lorank/issues/13"}}}

dennisg commented 7 years ago

Yes, tried that before to no avail...

currently trying to update the dts files using: https://github.com/beagleboard/bb.org-overlays

sudo sh -c "echo 'BB-SPIDEV0' > /sys/devices/platform/bone_capemgr/slots

results in:

root@lorank8:~/dtb/bb.org-overlays/src# cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1 
 1: PF----  -1 
 2: PF----  -1 
 3: PF----  -1 
 5: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-SPIDEV0

and

root@lorank8:~/dtb/bb.org-overlays/src# ls -al /dev/sp*
crw-rw---T 1 root spi 153, 0 Dec 28 18:05 /dev/spidev1.0
crw-rw---T 1 root spi 153, 1 Dec 28 18:05 /dev/spidev1.1

so still surprisingly (to me) no spidev0 device...

can you provide me any further pointers ?

thanks!

dennisg commented 7 years ago

To put it in another fashion:

At some point you migrated to Beagleboards that boot linux 4.4. The one I have was shipped with linux 3.8.x

What did you do to enable linux 4.4 on the beagleboard with working SPI ? Should I just download a stock 4.4 linux image, transfer it from microSD to the eMMC (by means of the uEnv.txt settings) and from there re-install the lorank software ?

barthiddink commented 7 years ago

Hi Dennis, I'm out of my depth here. I hope you will get a suitable reaction or maybe a solution from Ruud.

Met vriendelijke groet, Best regards, Bart HiddinkCEO+31(0) 6 18213534 Ideetron b.v. Dorpsstraat 81, 3941JL, Doorn, The NetherlandsKvk:54371996 -------- Oorspronkelijk bericht --------Van: Dennis Geurts notifications@github.com Datum: 28-12-16 21:11 (GMT+01:00) Aan: Ideetron/Lorank Lorank@noreply.github.com Cc: Bart Hiddink bart@ideetron.nl, Comment comment@noreply.github.com Onderwerp: Re: [Ideetron/Lorank] upgraded to 4.4 - no SPI devices (#13) To put it in another fashion: At some point you migrated to Beagleboards that boot linux 4.4. The one I have was shipped with linux 3.8.x What did you do to enable linux 4.4 on the beagleboard with working SPI ? Should I just download a stock 4.4 linux image, transfer it from microSD to the eMMC (by means of the uEnv.txt settings) and from there re-install the lorank software ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/Ideetron/Lorank","title":"Ideetron/Lorank","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/Ideetron/Lorank"}},"updates":{"snippets":[{"icon":"PERSON","message":"@dennisg in #13: To put it in another fashion:\r\n\r\nAt some point you migrated to Beagleboards that boot linux 4.4. The one I have was shipped with linux 3.8.x\r\n\r\nWhat did you do to enable linux 4.4 on the beagleboard with working SPI ? Should I just download a stock 4.4 linux image, transfer it from microSD to the eMMC (by means of the uEnv.txt settings) and from there re-install the lorank software ?\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/Ideetron/Lorank/issues/13#issuecomment-269533699"}}}

dennisg commented 7 years ago

okay, thanks anyway for your response!

devlaam commented 7 years ago

Hi, we do not support every BB / Linux kernel version out there. There are simply to many variations. Please post the result of: cat /etc/dogtag md5sum /etc/dogtag uname -a so i can see if we have it in the list. If not, the differences are usually small but may be cumbersome to figure out.

dennisg commented 7 years ago

My lorank8 is less than a year old... To me, this seems to boil down to getting SPI working again.

devlaam commented 7 years ago

Well, based on this info the hardware is supported but the kernel on this hardware is not. Not because it is impossible, but simply because we did not test this combination. But indeed the steps that are needed to get SPI working are crucial, and i assume there will be no other issues to get the concentrator running. These are not Lorank specific though, so searching / posting in beagleboard forums may be beneficial. At the moment i am traveling so i cannot test/experiment.

dennisg commented 7 years ago

okay, thanks! I'm searching the interwebs already. If (when, I hope) I succeed I'll post my findings here for others to enjoy.

devlaam commented 7 years ago

That would be nice. For the moment i close this. As soon as i tested the kernel you use i will reopen.

dennisg commented 7 years ago

I managed to get the SPI devices up (the gateway isn't running yet).

okay, (not really familiar with BBB's/ BBG's) but part of it all boils down to this:

The newer kernels (since 4.1, I think) seem to have different locations for adding Capes

Where one used to do:

cat "BB-SPIDEV0" > /sys/devices/bone_capemgr.*/slots

you now have to do:

cat "BB-SPIDEV0" > /sys/devices/platform/bone_capemgr/slots

It seems the SPI dtbo files (firmware) weren't available in the initrd.img which means they cannot be loaded from /lib/firmware during boot because that directory isn't available yet.

Also /etc/init.d/capemgr.sh still pointed to the old location so adding CAPE=BB-SPIDEV0 to /etc/defaults/capemgr would not correctly load them after boot.

Now with a corrected /etc/init.d/capemgr.sh I can autoload the dtbo's.

root@lorank8:/boot# cat /etc/default/capemgr 
# Default settings for capemgr. This file is sourced by /bin/sh from
# /etc/init.d/capemgr.sh

# Options to pass to capemgr
CAPE=BB-SPIDEV0,BB-SPIDEV1
crw-rw---T 1 root spi 153, 2 Dec 29 11:49 /dev/spidev1.0
crw-rw---T 1 root spi 153, 3 Dec 29 11:49 /dev/spidev1.1
crw-rw---T 1 root spi 153, 0 Dec 29 11:48 /dev/spidev2.0
crw-rw---T 1 root spi 153, 1 Dec 29 11:48 /dev/spidev2.1

This is a start... (also cloned https://github.com/beagleboard/bb.org-overlay, recompiled and installed those dts files)

I'm still a bit confused though, if I look at /root/lorank8-0.2.4/lora_gateway/libloragw/inc/lorank.h you use /dev/spidev1.0 which I now have available.

Is it correct that loading BB-SPIDEV0 results in /dev/spidev1.0 and /dev/spidev1.1 to become available ? And is my assumption also correct that thus a Lorank8 uses pins: P9.17, P9.18, P9.21 and P9.22 for SPI communication ?

I haven't got the libloragw tests working yet

dennisg commented 7 years ago

okay, I got it working again. LoRaWAN is available again!

so, my previous message explains how to get SPI working again (>4.1), to get the IC880A working again I had to completely disconnect it from the board.

That seems to have done the trick.

I will investigate further into getting the firmware files available earlier during boot, but that's not really important.

Thanks!

vanthome commented 7 years ago

I think on 4.4 kernels the way to get SPI0 is described here and is much easier:

https://github.com/beagleboard/bb.org-overlays/blob/bd11d76e1e07c3b5ae6a8bd30b760e48e53da914/readme.md#bbb-compatibility-issues

You basically just have to add dtb=am335x-boneblack-emmc-overlay.dtb to uEndv.txt and remove all the previous methods.

dennisg commented 7 years ago

Thanks @vanthome, I will try that in the near future

vanthome commented 7 years ago

@dennisg

Have you tried with the latest 4.4 series kernel as well? I cant seem to get it to work. Only 4.1 and 3.8 kernels work for me.

dennisg commented 7 years ago

@vanthome I am currently using:

root@lorank8:~# uname -an
Linux lorank8 4.4.39-bone15 #1 Sat Dec 17 16:14:57 UTC 2016 armv7l GNU/Linux

There, my setup works (as in: using capemgr with CAPE=BB-SPIDEV0 in /etc/defaults/capemgr after bootup)

A minute ago I tried your suggestion(dtb=etc): didn't work. returning to my setup it still doesn't work. I probably have upset the IC880A and made it stop communicating over SPI. Currently not near the device but I think I have to completely powerdown the unit again to make it work again.

vanthome commented 7 years ago

Please try that in uEnv.txt:

dtb=am335x-boneblack-emmc-overlay.dtb
cape_enable=bone_capemgr.enable_partno=BB-SPIDEV0

This 100% works for me (spi devices being available after boot).

vanthome commented 7 years ago

@dennisg could you please try my suggestion? I'm currently using 4.4..44 and although I have the SPI devices, I cannot get the board to work :(

dennisg commented 7 years ago

We'll, I'd rather not: it's my only gateway and I want to keep it online for now.

If you experience trouble connecting to the board over SPI, it seems to help sometimes to completely disconnect the board from the bbg.

Cheers, Dennis

On Tue, Feb 7, 2017, 21:18 Thomas Hoppe notifications@github.com wrote:

@dennisg https://github.com/dennisg could you please try my suggestion? I'm currently using 4.4..44 and although I have the SPI devices, I cannot get the board to work :(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ideetron/Lorank/issues/13#issuecomment-278127186, or mute the thread https://github.com/notifications/unsubscribe-auth/AAO37ZAGZxQKmwWYPEjTc969hRuzUwicks5raNGSgaJpZM4LXBea .