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: implement MR-O-QPSK #13912

Merged
merged 8 commits into from
Apr 29, 2020

Conversation

benpicco
Copy link
Contributor

Contribution description

This adds MR-O-QPSK modulation to the at86rf215 driver.

This also adds new commands to ifconfig to configure the new modulation parameters.

Testing procedure

Switch to the new PHY mode with ifconfig 7 set phy_mode mr-o-qpsk. Note that the L2-PDU has changed to 2022 bytes (802.15.4g can send 2047 byte frames).

You can now change the rate mode with ifconfig 7 set rate_mode 3 (range: 0…4) and the chip rate with ifconfig 7 set chips 1000 (possible values: 100, 200, 1000 & 2000 chip/s)

Issues/PRs references

split off #12128 but now the timings should be correct.

This adds PHY modes for IEEE 802.15.4-2003 and IEEE 802.15.4g-2012.
@benpicco benpicco added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: drivers Area: Device drivers labels Apr 20, 2020
@benpicco benpicco requested a review from fjmolinas April 20, 2020 23:15
@fjmolinas fjmolinas requested a review from jia200x April 21, 2020 09:43
Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments, for now I'm not looking at ed953fe since there was another PR adding it that sparked some controversy.

@fjmolinas
Copy link
Contributor

I've played around with sending packets with different configurations and everything is working.

@benpicco benpicco force-pushed the at86rf215-mr-qpsk branch from 4d2dd08 to 49535fe Compare April 22, 2020 16:23
@fjmolinas
Copy link
Contributor

My change requests have been addressed, I currently only have access to 1 openmote-b so I can only test that the base case still works pinging between an openmote-b and a usb-kw41z (I did have multiple openmote-b when testing at #13912 (comment)).

2020-04-28 14:20:53,046 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=90 ttl=64 rssi=-28 dBm time=21.325 ms
2020-04-28 14:20:53,142 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=91 ttl=64 rssi=-28 dBm time=21.321 ms
2020-04-28 14:20:53,252 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=92 ttl=64 rssi=-28 dBm time=23.558 ms
2020-04-28 14:20:53,348 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=93 ttl=64 rssi=-28 dBm time=21.345 ms
2020-04-28 14:20:53,445 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=94 ttl=64 rssi=-29 dBm time=23.870 ms
2020-04-28 14:20:53,542 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=95 ttl=64 rssi=-28 dBm time=21.018 ms
2020-04-28 14:20:53,652 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=96 ttl=64 rssi=-29 dBm time=22.598 ms
2020-04-28 14:20:53,748 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=97 ttl=64 rssi=-28 dBm time=21.314 ms
2020-04-28 14:20:53,844 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=98 ttl=64 rssi=-29 dBm time=20.670 ms
2020-04-28 14:20:53,955 # 108 bytes from fe80::2063:632b:622a:6d52%8: icmp_seq=99 ttl=64 rssi=-28 dBm time=23.865 ms
2020-04-28 14:20:53,955 # 
2020-04-28 14:20:53,955 # --- fe80::2063:632b:622a:6d52 PING statistics ---
2020-04-28 14:20:53,956 # 100 packets transmitted, 100 packets received, 0% packet loss
2020-04-28 14:20:53,956 # round-trip min/avg/max = 19.462/21.806/29.816 ms

@benpicco could you provide some test output for mr-o-qpsk?

@benpicco
Copy link
Contributor Author

@benpicco could you provide some test output for mr-o-qpsk?

2020-04-28 21:26:35,466 #  ping6 fe80::18f9:8f5f:305d:58c%8
2020-04-28 21:26:35,482 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=0 ttl=64 rssi=-44 dBm time=6.698 ms
2020-04-28 21:26:36,476 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=1 ttl=64 rssi=-42 dBm time=6.697 ms
2020-04-28 21:26:37,482 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=2 ttl=64 rssi=-45 dBm time=6.698 ms
2020-04-28 21:26:37,482 # 
2020-04-28 21:26:37,484 # --- fe80::18f9:8f5f:305d:58c PING statistics ---
2020-04-28 21:26:37,485 # 3 packets transmitted, 3 packets received, 0% packet loss
2020-04-28 21:26:37,486 # round-trip min/avg/max = 6.697/6.697/6.698 ms
ifconfig 8
2020-04-28 21:26:43,993 #  ifconfig 8
2020-04-28 21:26:44,009 # Iface  8  HWaddr: 3A:A4  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK 
2020-04-28 21:26:44,010 #           
2020-04-28 21:26:44,011 #           Long HWaddr: 22:68:31:23:59:F5:D2:38 
2020-04-28 21:26:44,013 #            TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4 
2020-04-28 21:26:44,025 #           AUTOACK  ACK_REQ  CSMA  L2-PDU:102 MTU:1280  HL:64  RTR  
2020-04-28 21:26:44,026 #           6LO  IPHC  
2020-04-28 21:26:44,027 #           Source address length: 8
2020-04-28 21:26:44,028 #           Link type: wireless
2020-04-28 21:26:44,030 #           inet6 addr: fe80::2068:3123:59f5:d238  scope: link  VAL
2020-04-28 21:26:44,041 #           inet6 group: ff02::2
2020-04-28 21:26:44,042 #           inet6 group: ff02::1
2020-04-28 21:26:44,043 #           inet6 group: ff02::1:fff5:d238
2020-04-28 21:26:44,044 #           
2020-04-28 21:26:44,045 #           Statistics for Layer 2
2020-04-28 21:26:44,046 #             RX packets 6  bytes 237
2020-04-28 21:26:44,058 #             TX packets 6 (Multicast: 3)  bytes 237
2020-04-28 21:26:44,058 #             TX succeeded 6 errors 0
2020-04-28 21:26:44,059 #           Statistics for IPv6
2020-04-28 21:26:44,060 #             RX packets 6  bytes 348
2020-04-28 21:26:44,073 #             TX packets 6 (Multicast: 3)  bytes 348
2020-04-28 21:26:44,074 #             TX succeeded 6 errors 0
2020-04-28 21:26:44,074 # 
> ifconfig 8 set phy mr-o-qpsk
2020-04-28 21:26:52,329 #  ifconfig 8 set phy mr-o-qpsk
2020-04-28 21:26:52,330 # success: set PHY mode MR-O-QPSK
ifconfig 8
2020-04-28 21:27:09,128 #  ifconfig 8
2020-04-28 21:27:09,130 # Iface  8  HWaddr: 3A:A4  Channel: 26  NID: 0x23  PHY: MR-O-QPSK 
2020-04-28 21:27:09,131 #            chip rate: 2000  rate mode: 0 
2020-04-28 21:27:09,144 #           Long HWaddr: 22:68:31:23:59:F5:D2:38 
2020-04-28 21:27:09,145 #            TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4 
2020-04-28 21:27:09,147 #           AUTOACK  ACK_REQ  CSMA  L2-PDU:2022 MTU:1280  HL:64  RTR  
2020-04-28 21:27:09,147 #           6LO  IPHC  
2020-04-28 21:27:09,160 #           Source address length: 8
2020-04-28 21:27:09,161 #           Link type: wireless
2020-04-28 21:27:09,163 #           inet6 addr: fe80::2068:3123:59f5:d238  scope: link  VAL
2020-04-28 21:27:09,164 #           inet6 group: ff02::2
2020-04-28 21:27:09,164 #           inet6 group: ff02::1
2020-04-28 21:27:09,176 #           inet6 group: ff02::1:fff5:d238
2020-04-28 21:27:09,177 #           
2020-04-28 21:27:09,177 #           Statistics for Layer 2
2020-04-28 21:27:09,178 #             RX packets 7  bytes 280
2020-04-28 21:27:09,179 #             TX packets 8 (Multicast: 5)  bytes 323
2020-04-28 21:27:09,192 #             TX succeeded 8 errors 0
2020-04-28 21:27:09,193 #           Statistics for IPv6
2020-04-28 21:27:09,194 #             RX packets 7  bytes 412
2020-04-28 21:27:09,195 #             TX packets 8 (Multicast: 5)  bytes 476
2020-04-28 21:27:09,196 #             TX succeeded 8 errors 0
2020-04-28 21:27:09,197 # 
ping6 fe80::18f9:8f5f:305d:58c%8
2020-04-28 21:27:16,200 #  ping6 fe80::18f9:8f5f:305d:58c%8
2020-04-28 21:27:16,263 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=0 ttl=64 rssi=-46 dBm time=43.658 ms
2020-04-28 21:27:17,257 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=1 ttl=64 rssi=-45 dBm time=43.631 ms
2020-04-28 21:27:18,263 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=2 ttl=64 rssi=-42 dBm time=43.633 ms
2020-04-28 21:27:18,264 # 
2020-04-28 21:27:18,265 # --- fe80::18f9:8f5f:305d:58c PING statistics ---
2020-04-28 21:27:18,267 # 3 packets transmitted, 3 packets received, 0% packet loss
2020-04-28 21:27:18,268 # round-trip min/avg/max = 43.631/43.640/43.658 ms
> ifconfig 8 set rate_mode 4
2020-04-28 21:27:28,279 #  ifconfig 8 set rate_mode 4
2020-04-28 21:27:28,295 # success: set rate mode on interface 8 to 4
ping6 fe80::18f9:8f5f:305d:58c%8
2020-04-28 21:27:37,863 #  ping6 fe80::18f9:8f5f:305d:58c%8
2020-04-28 21:27:37,895 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=0 ttl=64 rssi=-47 dBm time=20.933 ms
2020-04-28 21:27:38,888 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=1 ttl=64 rssi=-39 dBm time=20.933 ms
2020-04-28 21:27:39,895 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=2 ttl=64 rssi=-43 dBm time=20.933 ms
2020-04-28 21:27:39,895 # 
2020-04-28 21:27:39,896 # --- fe80::18f9:8f5f:305d:58c PING statistics ---
2020-04-28 21:27:39,898 # 3 packets transmitted, 3 packets received, 0% packet loss
2020-04-28 21:27:39,910 # round-trip min/avg/max = 20.933/20.933/20.933 ms
> ifconfig 8 set chips 100
2020-04-28 21:27:50,886 #  ifconfig 8 set chips 100
2020-04-28 21:27:50,902 # success: set chip rate on interface 8 to 100
> ifconfig 8 set rate_mode 0
2020-04-28 21:27:58,533 #  ifconfig 8 set rate_mode 0
2020-04-28 21:27:58,535 # success: set rate mode on interface 8 to 0
> ifconfig 8
2020-04-28 21:28:01,077 #  ifconfig 8
2020-04-28 21:28:01,093 # Iface  8  HWaddr: 3A:A4  Channel: 26  NID: 0x23  PHY: MR-O-QPSK 
2020-04-28 21:28:01,094 #            chip rate: 100  rate mode: 0 
2020-04-28 21:28:01,096 #           Long HWaddr: 22:68:31:23:59:F5:D2:38 
2020-04-28 21:28:01,109 #            TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4 
2020-04-28 21:28:01,111 #           AUTOACK  ACK_REQ  CSMA  L2-PDU:2022 MTU:1280  HL:64  RTR  
2020-04-28 21:28:01,111 #           6LO  IPHC  
2020-04-28 21:28:01,112 #           Source address length: 8
2020-04-28 21:28:01,113 #           Link type: wireless
2020-04-28 21:28:01,125 #           inet6 addr: fe80::2068:3123:59f5:d238  scope: link  VAL
2020-04-28 21:28:01,126 #           inet6 group: ff02::2
2020-04-28 21:28:01,127 #           inet6 group: ff02::1
2020-04-28 21:28:01,127 #           inet6 group: ff02::1:fff5:d238
2020-04-28 21:28:01,128 #           
2020-04-28 21:28:01,141 #           Statistics for Layer 2
2020-04-28 21:28:01,142 #             RX packets 14  bytes 539
2020-04-28 21:28:01,143 #             TX packets 16 (Multicast: 7)  bytes 625
2020-04-28 21:28:01,144 #             TX succeeded 16 errors 0
2020-04-28 21:28:01,145 #           Statistics for IPv6
2020-04-28 21:28:01,157 #             RX packets 14  bytes 788
2020-04-28 21:28:01,158 #             TX packets 16 (Multicast: 7)  bytes 916
2020-04-28 21:28:01,158 #             TX succeeded 16 errors 0
2020-04-28 21:28:01,159 # 
ping6 fe80::18f9:8f5f:305d:58c%8
2020-04-28 21:28:14,725 #  ping6 fe80::18f9:8f5f:305d:58c%8
2020-04-28 21:28:14,918 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=0 ttl=64 rssi=-49 dBm time=182.001 ms
2020-04-28 21:28:15,925 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=1 ttl=64 rssi=-50 dBm time=182.001 ms
2020-04-28 21:28:16,918 # 12 bytes from fe80::18f9:8f5f:305d:58c%8: icmp_seq=2 ttl=64 rssi=-50 dBm time=182.001 ms
2020-04-28 21:28:16,918 # 
2020-04-28 21:28:16,932 # --- fe80::18f9:8f5f:305d:58c PING statistics ---
2020-04-28 21:28:16,934 # 3 packets transmitted, 3 packets received, 0% packet loss
2020-04-28 21:28:16,935 # round-trip min/avg/max = 182.001/182.001/182.001 ms

@fjmolinas
Copy link
Contributor

@benpicco please squash!

benpicco and others added 7 commits April 29, 2020 10:41
Define options for IEEE 802.15.4g MR-O-QPSK as well as shell commands
to set them via ifconfig.
All option have a space behind them. This fixes the formatting of the
NID parameter if there are options after it.
IEEE 802.15.4g-2012 specifies a PDU of 2047 for it's PHY modes, so
query the driver for the mode before returning the PDU.

If none of the new modes is used, don't query the driver to not incure
a penalty on existing platforms.
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 29, 2020
@benpicco benpicco force-pushed the at86rf215-mr-qpsk branch from 32d5694 to 6ce0092 Compare April 29, 2020 08:42
@benpicco
Copy link
Contributor Author

benpicco commented Apr 29, 2020

I also printed the size of the TX frame to check if GNRC correctly picks up the larger PDU:

# legacy O-QPSK - 127 byte PDU, packet will fragment
ping6 fe80::2068:3123:59f5:d238%8 -s 200
2020-04-29 11:57:15,361 #  ping6 fe80::2068:3123:59f5:d238%8 -s 200
2020-04-29 11:57:15,363 # sending 116 bytes
2020-04-29 11:57:15,370 # sending 122 bytes
2020-04-29 11:57:15,377 # sending 50 bytes
2020-04-29 11:57:15,405 # 208 bytes from fe80::2068:3123:59f5:d238%8: icmp_seq=0 ttl=64 rssi=-52 dBm time=35.700 ms
2020-04-29 11:57:16,079 # sending 43 bytes
2020-04-29 11:57:16,363 # sending 116 bytes
2020-04-29 11:57:16,370 # sending 122 bytes
2020-04-29 11:57:16,377 # sending 50 bytes
2020-04-29 11:57:16,405 # 208 bytes from fe80::2068:3123:59f5:d238%8: icmp_seq=1 ttl=64 rssi=-54 dBm time=35.723 ms
2020-04-29 11:57:16,634 # sending 43 bytes
2020-04-29 11:57:17,363 # sending 116 bytes
2020-04-29 11:57:17,370 # sending 122 bytes
2020-04-29 11:57:17,377 # sending 50 bytes
2020-04-29 11:57:17,405 # 208 bytes from fe80::2068:3123:59f5:d238%8: icmp_seq=2 ttl=64 rssi=-55 dBm time=35.724 ms
2020-04-29 11:57:17,405 # 
2020-04-29 11:57:17,410 # --- fe80::2068:3123:59f5:d238 PING statistics ---
2020-04-29 11:57:17,415 # 3 packets transmitted, 3 packets received, 0% packet loss
2020-04-29 11:57:17,419 # round-trip min/avg/max = 35.700/35.715/35.724 ms
> ifconfig set phy mr-o-qpsk # PDU is now 2047 byte
2020-04-29 11:57:21,912 #  ifconfig 8 set phy mr-o-qpsk
2020-04-29 11:57:21,915 # success: set PHY mode MR-O-QPSK
ping6 fe80::2068:3123:59f5:d238%8 -s 2002020-04-29 11:57:26,080 #  sending 43 bytes

2020-04-29 11:57:26,321 # ping6 fe80::2068:3123:59f5:d238%8 -s 200
2020-04-29 11:57:26,323 # sending 232 bytes
2020-04-29 11:57:26,481 # 208 bytes from fe80::2068:3123:59f5:d238%8: icmp_seq=0 ttl=64 rssi=-52 dBm time=152.303 ms
2020-04-29 11:57:26,635 # sending 43 bytes
2020-04-29 11:57:27,323 # sending 232 bytes
2020-04-29 11:57:27,481 # 208 bytes from fe80::2068:3123:59f5:d238%8: icmp_seq=1 ttl=64 rssi=-51 dBm time=152.301 ms
2020-04-29 11:57:28,323 # sending 232 bytes
2020-04-29 11:57:28,580 # 208 bytes from fe80::2068:3123:59f5:d238%8: icmp_seq=2 ttl=64 rssi=-51 dBm time=250.577 ms
2020-04-29 11:57:28,580 # 
2020-04-29 11:57:28,584 # --- fe80::2068:3123:59f5:d238 PING statistics ---
2020-04-29 11:57:28,589 # 3 packets transmitted, 3 packets received, 0% packet loss
2020-04-29 11:57:28,595 # round-trip min/avg/max = 152.301/185.060/250.577 ms

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, my change rquests have been addressed. I did some initial testing at the start of the review when I had the required HW, @benpicco provided test output again at the end of the review process. I also tested that default configuration was still working.

@fjmolinas fjmolinas merged commit 80b3002 into RIOT-OS:master Apr 29, 2020
@benpicco benpicco deleted the at86rf215-mr-qpsk branch April 29, 2020 10:44
@benpicco
Copy link
Contributor Author

Thank you for the review! I'll try to add MR-OFDM and MR-FSK soon

@miri64 miri64 added this to the Release 2020.07 milestone Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants