Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/at86rf215: Incorrect channel number set for subGHz #15906

Open
nagrawal63 opened this issue Feb 1, 2021 · 1 comment
Open

drivers/at86rf215: Incorrect channel number set for subGHz #15906

nagrawal63 opened this issue Feb 1, 2021 · 1 comment
Assignees
Labels
Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@nagrawal63
Copy link
Contributor

Description

Inside the at86rf215_reset_and_cfg() function, the channel number for subGHz radio is set to CONFIG_AT86RF215_DEFAULTL_SUBGHZ_CHANNEL(5) at the start of at86rf215_reset_and_cfg(dev) function but is later set to zero while initialising the modulation for the radio in _end_configure_OQPSK(dev).

This stops the user from using a channel number since _end_configure_OQPSK(dev) will always set the channel number to 0.

Steps to reproduce the issue

Run the basic gnrc_networking example and execute the command ifconfig on the shell to see the interface configuration.

Hardware used:
Board: nucleo-l476rg
Radio: at86rf215

Expected results

The channel number is set to the number in CONFIG_AT86RF215_DEFAULTL_SUBGHZ_CHANNEL (or a valid number is CONFIG_AT86RF215_DEFAULTL_SUBGHZ_CHANNEL isn't valid)

Actual results

2021-02-01 18:30:26,741 # Iface  6  HWaddr: 71:68  Channel: 0  Page: 2  NID: 0x23  PHY: O-QPSK 
2021-02-01 18:30:26,742 #           
2021-02-01 18:30:26,747 #           Long HWaddr: AA:C4:2A:8E:5E:47:F1:68 
2021-02-01 18:30:26,753 #            TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4 
2021-02-01 18:30:26,760 #           AUTOACK  ACK_REQ  CSMA  L2-PDU:102  MTU:1280  HL:64  RTR  
2021-02-01 18:30:26,763 #           RTR_ADV  6LO  IPHC  
2021-02-01 18:30:26,766 #           Source address length: 8
2021-02-01 18:30:26,768 #           Link type: wireless
2021-02-01 18:30:26,774 #           inet6 addr: fe80::a8c4:2a8e:5e47:f168  scope: link  VAL
2021-02-01 18:30:26,781 #           inet6 addr: 2001:db8::a8c4:2a8e:5e47:f168  scope: global  TNT[3]
2021-02-01 18:30:26,784 #           inet6 group: ff02::2
2021-02-01 18:30:26,786 #           inet6 group: ff02::1
2021-02-01 18:30:26,790 #           inet6 group: ff02::1:ff47:f168
2021-02-01 18:30:26,791 #           
2021-02-01 18:30:26,794 #           Statistics for Layer 2
2021-02-01 18:30:26,797 #             RX packets 2  bytes 158
2021-02-01 18:30:26,801 #             TX packets 14 (Multicast: 8)  bytes 860
2021-02-01 18:30:26,805 #             TX succeeded 8 errors 6
2021-02-01 18:30:26,807 #           Statistics for IPv6
2021-02-01 18:30:26,810 #             RX packets 1  bytes 144
2021-02-01 18:30:26,816 #             TX packets 14 (Multicast: 8)  bytes 1104
2021-02-01 18:30:26,818 #             TX succeeded 14 errors 0

Versions

Operating System Environment
----------------------------
         Operating System: "Ubuntu" "18.04.5 LTS (Bionic Beaver)"
                   Kernel: Linux 4.15.0-135-generic x86_64 x86_64
             System shell: /bin/dash (probably dash)
             make's shell: /bin/dash (probably dash)

Installed compiler toolchains
-----------------------------
               native gcc: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
        arm-none-eabi-gcc: arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
                  avr-gcc: missing
         mips-mti-elf-gcc: missing
           msp430-elf-gcc: missing
       riscv-none-elf-gcc: missing
  riscv64-unknown-elf-gcc: missing
     riscv-none-embed-gcc: missing
     xtensa-esp32-elf-gcc: missing
   xtensa-esp8266-elf-gcc: missing
                    clang: clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)

Installed compiler libs
-----------------------
     arm-none-eabi-newlib: "3.1.0"
      mips-mti-elf-newlib: missing
        msp430-elf-newlib: missing
    riscv-none-elf-newlib: missing
riscv64-unknown-elf-newlib: missing
  riscv-none-embed-newlib: missing
  xtensa-esp32-elf-newlib: missing
xtensa-esp8266-elf-newlib: missing
                 avr-libc: missing (missing)

Installed development tools
---------------------------
                   ccache: ccache version 3.4.1
                    cmake: cmake version 3.19.1
                 cppcheck: Cppcheck 1.82
                  doxygen: 1.8.13
                      git: git version 2.17.1
                     make: GNU Make 4.1
                  openocd: Open On-Chip Debugger 0.10.0+dev-01089-g3bfe4926 (2020-02-24-15:06)
                   python: Python 2.7.17
                  python2: Python 2.7.17
                  python3: Python 3.6.9
                   flake8: error: /usr/bin/python3: No module named flake8
               coccinelle: missing

@jeandudey jeandudey added Area: network Area: Networking and removed Area: network Area: Networking labels Feb 20, 2021
@jeandudey
Copy link
Contributor

Can confirm it happens, seems to be that for now only EU 868–870 MHz band is supported, although it should still allow to specify at least one of the 3 channels available for this band on O-QPSK, probably not yet implemented as getting the channel scheme is quite tricky and the channel spacing is not defined clearly on the IEEE 802.15.4-2015 Std.

Screenshot from 2021-02-20 13-44-37

The difference between channel 0 and 1 is 650 kHz, and between 1 and 2 it's 575 kHz.

/* currently only EU-868 MHz band is supported */
#define QPSK_CHANNEL_SPACING_SUBGHZ (650U) /* kHz */
#define QPSK_CENTER_FREQUENCY_SUBGHZ (868300U) /* Hz */

The limitation happens here and hence the reason it defaults to channel 0:

dev->num_chans = is_subGHz(dev) ? 1 : 16;

@aabadie aabadie added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label May 20, 2021
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 22, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

No branches or pull requests

7 participants