-
Notifications
You must be signed in to change notification settings - Fork 2.1k
at86rf2xx: fix lqi reading #3954
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
Conversation
Hooray! |
Nice to see one more problem with the atrf driver solved! Though I am not sure, if I completely like the actual solution: allocating a full packet on the stack could be potential dangerous. When rewriting the driver, one of the main ideas was to get rid of this additional layer of buffering. Now it seems that this is not possible when wanting to use LQI values I guess we can not prevent this. So instead of allocating this temporary buffer on the stack, I think I would tend to allocate it statically as part of the device descriptor. This could also simplify the rest of the receive function code a bit... |
Sure. This was the easiest approach to be honest. Would you take over this part @haukepetersen? |
This would also fix RSSI readout? In my setup I see that the RSSI is read Just curious :)
|
I don't think so. RSSI readout doesn't really change with this PR. Do you use RSSI for something? AFAIK there's no documentation in RIOT what |
Thanks for the reply, but that was a different problem :) |
Btw that's the same for Linux for one simple reason: at least RSSI is vendor specific. Some vendors assign RSSI values between 0 and 3 while other uses the full width of the data type. |
Good job @daniel-k ! Hopefully LQI and RSSI will be useful one day with RPL ;-)
|
In the current approach we the only read access out of frame buffer sequence is the LQI read access. Maybe we could change the current approach to something using fb access like at86rf2xx_fb_read_start(dev); /* CS, SPI acquire and send SPI FB access */
...
at86rf2xx_fb_read(dev, mhr, 2); /* read FCS */
hdr_len = _get_frame_hdr_len(mhr);
at86rf2xx_fb_read(dev, &(mhr[2]), hdr_len - 2); /* read addresses and the like */
...
payload = gnrc_pktbuf_add(hdr, NULL, (pkt_len - hdr_len), dev->proto);
at86rf2xx_fb_read(dev, payload->data, payload->size); /* dump payload in pkt buffer snip */
...
at86rf2xx_fb_read(dev, &(netif->lqi), 1);
at86rf2xx_fb_read_stop(dev); /* chip unselect, SPI release */
dev->event_cb(NETDEV_EVENT_RX_COMPLETE, payload); |
@thomaseichinger, ok, your approach seems a bit cleaner, I don't have a strong opinion on which way to go since the result is going to be the same |
205b853
to
2d1973f
Compare
I really liked @thomaseichinger proposal. It seems to work and it should be quite easy to review now because code-wise not much has changed. |
I tested it, I got lot of 255 values and some below. Seems to work but how may I really tell that it works.
How may I make the signal quality worse? Otherwise I ACK this PR and I'll merge it. |
@bapclenet |
@haukepetersen You okay with the current implementation? |
|
||
at86rf2xx_fb_read(dev, &(netif->lqi), 1); | ||
|
||
#ifndef MODULE_AT86RF231 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked for the 212b as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I have 😄 Yes, it has ED value after LQI, so it's fine. See p.133
Great let's merged, will come back if we find any problem concerning LQI value if @haukepetersen agrees on the new implementation? |
ping @haukepetersen |
Sorry for the sleepiness on my side... I am good with this change - though I have no time to test today. But @bapclenet, if you ack still holds, I say lets merge this! |
NACK for now, doesn't work for iotlab-m3. |
Damn! Deadline for my thesis is next tuesday so I won't be able to fix this until then 👿 Whats the release deadline for 2015.12 again? |
Feature freeze is today, I'm investigating. |
Ok, found the problem. Please see daniel-k#4. |
@daniel-k Please squash. |
ACK when squashed and Travis passed. |
171b5db
to
a643789
Compare
@thomaseichinger |
@thomaseichinger |
@daniel-k Happens at times, kicked the jobs.
|
Woohoo, Travis is happy. Finally this PR can be merged :) |
\o/ |
Great! Thanks |
Cool! Nice job everyone! |
I finally fixed the LQI reading for the at86rf2xx driver, as I already attempted in #2884. The problem was that LQI can only be accessed by a framebuffer read access, not by SRAM read. Therefore the whole packet needs to be read at once, so I needed to rework the receive function a bit.