简体   繁体   English

nRF24-收到数据但未收到完整的消息

[英]nRF24 - data received but not whole message

Here is the setup. 这是设置。 Arduino #1 has a w5100 ethernet shield running a webserver accepting GET strings. Arduino#1具有w5100以太网屏蔽,该屏蔽运行运行接受GET字符串的Web服务器。 It then parses out the data and sends it wirelessly to the other nodes using nRF24l10 transceivers. 然后,它解析出数据,并使用nRF24l10收发器将其无线发送到其他节点。 I'm using maniacbug's RF24 and RF24Network libraries. 我正在使用maniacbug的RF24和RF24Network库。 Also due to having the ethernet shield and the wireless I had to use a modified RF24 for the base that supports soft SPI. 同样由于具有以太网屏蔽和无线功能,我不得不对支持软SPI的基座使用经过改进的RF24。

Arduino #2 is just the nRF24L10. Arduino#2只是nRF24L10。

What is working. 什么工作。 Sending GET's to Arduino #1 works. 将GET发送到Arduino#1的工作原理。 It parses the information. 它解析信息。 It then calls the send routine and that says it's ok. 然后,它调用发送例程,并且说没问题。

On arduino #2 I get a "Received:" printout but no message. 在arduino#2上,我得到“已接收:”打印输出,但没有消息。 I'm not sure what is wrong. 我不知道怎么了。 The code is taken right from maniacbug's tx and rx example. 该代码直接取自maniacbug的tx和rx示例。 Except I had to convert my sendString to a char to send. 除非我必须将sendString转换为char以发送。

I'm wondering if it's one of the following things but I'm not quite sure how to debug. 我想知道这是否是以下事情之一,但我不确定如何调试。

  1. That the addition of the RF24Network library broke the softSPI. RF24Network库的添加破坏了softSPI。 I've been very careful to remove one libray and add the other when I compile. 在编译时,我非常小心地删除了一个libray并添加了另一个。 Though if this were the case I'd never see the "Received:" would i? 即使是这种情况,我也永远不会看到“已接收:”我会吗?

  2. It doesn't like my conversion from string to char? 它不喜欢我从字符串到char的转换吗?

Here is the code. 这是代码。

Base Station: http://pastebin.com/Ehy8pz4Z Receiver : http://pastebin.com/2mz9FjsR 基站: http : //pastebin.com/Ehy8pz4Z接收器: http : //pastebin.com/2mz9FjsR

Here is the modified RF24+ softspi library. 这是修改后的RF24 + softspi库。 https://github.com/shnae/rf24_plus_softSPI if that helps. https://github.com/shnae/rf24_plus_softSPI,如果有帮助。

I don't think just adding the nrf24network library breaks that but since it calls SPI.begin() it might. 我不认为仅添加nrf24network库就可以解决此问题,但由于它调用了SPI.begin(),因此可能会这样做。 That's beyond my skillset.. 那超出了我的技能范围。

So as it turns out you need to put network.update(); 因此事实证明,您需要放入network.update();。 in loop.... If you only call it per request like I did it will not work. 循环中。...如果仅像我一样按请求调用它,则它将无法正常工作。 Hence the //do this regularly comment that you see for this. 因此//为此定期进行评论,您会为此看到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM