12

int, long, etc have different sizes depended on the compiler and target. Use explicit sizes to make sure you're variables have the size you want. Eg. uint8_t, int16_t or int32_t, ... (as @Mat commented) Also, I wouldn't use bool (if writing in C) as it's not really standard in C and the size is also implementation dependent: https://stackoverflow.com/...


12

There are three main issues you may need to deal with when passing structures between systems that use different processors. The first is that data types vary in size between architectures. You can avoid this for integers by avoiding the basic C types and instead using the fixed size types from stdint.h/cstdint. For floating point types this is less of a ...


9

In addition to the rule of always using fixed and predictable sizes across different architectures, it's also a good idea to pack your structs. This prevents the compiler from padding smaller variables with blanks to align them with the architecture's word boundary when needed. For example: struct Package { uint8_t doorOpened; uint16_t light; ...


6

If you look at the specification or datasheet for the nRF24l01+, you will see that the 32 byte payload is the maximum that the device can handle. For example: If you need to transmit anything larger than 32 bytes, you will need to develop a protocol that splits up your data into chunks of 32 bytes or less and sends the data in several packets. The actual ...


6

I've used NRF24L01+ chipset 2.4GHz wireless modules with Arduino before, and found them to be great, and super cheap (~$10 for 10 of them on ebay!). They have 3 modes of transmission: 250kbps, 1Mbps, and 2Mbps. The range decreases accordingly with higher bitrate, but the time spent sending a message does too. There are multiple Arduino libraries (e.g. RF24, ...


5

It does seem possible, check out this thread on Arduino forums, where cpixip worked directly with the NRF24 SPI interface to accomplish that. Here is the code he published, in case the link won't be available: #include <SPI.h> // Poor Man's Wireless 2.4GHz Scanner // // uses an nRF24L01p connected to an Arduino // // Cables are: // SS -&...


5

As most of the people have posted, the values for the pipe are arbitrary, but must follow the rules per the API: Pipes 1-5 should share the first 32 bits. Only the least significant byte should be unique, e.g. Before I answer your question, I think an explanation on Hex and Decimal values are needed. The 40 bit hexadecimal is a number representation ...


5

Your best strategy would be to write your own bootloader. The existing bootloader receives data through the serial port and writes it, a page at a time, to the flash. Your custom bootloader, instead, would receive the data through the nRF module and write it to flash, a page at a time. You could use the source code for the existing bootloader (maybe use ...


4

There is an Arduino optiboot fork for this now, which seems to handle what you want. You would use a PC, RPi or whatever that could run avrdude to send the update to an Arduino acting as the update server, which transmits the code to the client. The instructions on the page seem quite comprehensive.


4

Just added a 47uf capacitor to the pin 1 and 2 in NF24L01 ,then every thing worked fine this is the new setup .


4

Have you considered using real time clocks? You could synchornise them all ahead of time and then use any wireless protocol. Once a button is pressed, you'll look for the unit that reports the earliest time stamp and then once a window of a few seconds has passed let it know that it won. I'd consider using WIFI (802.11) with ESP8266s, RTCs and take a ...


4

The NRF24L01+ has inputs that are 5V tolerant! So you only need to provide 3.3V on the Vcc pin of the module, which you can do by putting a voltage regulator between it, and the 5V of the Trinket. So there isn't really any need to convert the Trinket to 3.3V. PS Remember to add some capacitors to the output of the voltage regulator, as the NRF needs a ...


3

I've used the usb battery chargers (marketed to recharge cell phones) with great success on many different Arduino boards. They come in a variety of mAH capacities and are easily recharged with any powered USB port/power adapter. Here's a link to one I've used. (I'm not affiliated with Duracell in any way). http://ww2.duracell.com/en-US/product/instant-usb-...


3

Your payload is too big. You will have to split it to smaller pieces. NOTE: If you'd use a library like RF24Mesh then you'd not have to worry about it.


3

If you're working with remote sensor nodes, perhaps consider the MySensors library. It's got support for two methods of delivering OTA updates - one using a node.js controller running on a rPi; and another third-party solution with a .NET front-end. Failing that, you could borrow the bootloader code from the library and customise to your own needs.


3

In my situation the issue was with the Transmitter not continuing to transmit after a delay. I was able to resolve the issue using the powerDown (http://maniacbug.github.io/RF24/classRF24.html#aa0a51923a09ba4f3478aba9be0f8a6a1) and powerUp (http://maniacbug.github.io/RF24/classRF24.html#a5cdaf47aa0edd6dca1b9a8bb7972a1a3) functions. Here is a snipet of my ...


3

Many questions so broad answers, but hopefully informative for your research What is the nature of the data sent between units? I want to send integers, possibly even text. Is that possible? Do I need to convert to binary or something? It depends broadly on what you use. If you use an ethernet peripheral then the communications will be entire ethernet ...


3

Yes, and yes. A module without an antenna is exactly the same as a module with an antenna, it's just that the antenna is part of the PCB. Yes, the module with the antenna will have more sensitivity (able to receive fainter signals) as well as more transmitting power. The same is true of the modules with the power amplifier. They again have even more ...


3

What you are asking is very tricky at best. Your average Arduino doesn't have enough memory to start storing arrays of Strings. Instead you will need to "distil" the information as it comes in and store the distilled information. If the possible keys are all known beforehand then you can assign a number to each possible key - say RCP is 1, CMD is 2, VAL is ...


3

The main thing that I can see wrong with your sketch is that the logic of your methodology is backwards. You are spending most of your time either with the radio asleep, or not in listening mode, so it can not receive anything. Instead you need to spend all your time in listening mode waiting for messages to arrive, and only when the button changes state ...


3

In your situation, your best bet is probably to use the standard C function strcpy: payload_t payload; char* source = "abcdef"; strcpy(payload.sensorid, source); Note that source string does not have to be declared as char source[20] and can be declared as the rather standard C string char*. Also, since you are limiting the size of the string to be passed ...


3

You have two options: Use an nRF24L01+ on the Arduino and dismantle the controller to rip out the innards, replacing them with another Arduino and another nRF24L01+. Do not use the nRF24L01+, instead, rip apart the car and salvage the receiver from it, then work out how you can wire that to the Arduino. The car's controller will not talk to the nRF24L01+. ...


3

It's likely an issue related to the modules' electric supply. The effects can be packet loss (even down to zero bps) or loss of communication with the module. Two things have to be covered with the nRF modules for them to work: current draw (i.e. power), decoupling/filtering (i.e. bypass capacitors). Since you don't mention specific devices, I'm ...


3

The read() method works character-wise, not element-wise. Then you have to rethink your algorithm to loop over characters: store each character in a buffer send the whole buffer (i.e. a single element) when you see a delimiter Example: const size_t BUFFER_SZ = ...; char buffer[BUFFER_SZ]; size_t pos = 0; // current write position in buffer int c; // ...


3

You have multiple copies of the library. Delete the folder located at: C:\Users\Owner\Documents\Arduino\libraries\RF24ArduinoCommunicator-master


3

According to the source code: const static unsigned int max_frame_payload_size = MAX_FRAME_SIZE-sizeof(RF24NetworkHeader); that would be 24 bytes. Maximum lenght of payload for NRF24L01+ is 32 bytes and the RF24NetworkHeader seem to be 8 bytes long. So you can send up to 24 bytes in one package. EDIT: Here is the stripped RF24NetworkHeader declaration ...


3

Why wouldn't you be able to? The compiler runs on the computer, not on the Arduino board. You don't need a board to be connected to compile either. If you enable verbose output during compile in the Arduino IDE settings it will tell you where it puts the resulting .hex file, after which you can use avr-dude to upload it to the target MCU. If you want to ...


3

Interesting. I have been having an issue with nRF24L01's as well so I tried your code (modified to work toggling the transmitter and printing the output). You are possibly getting the same issue as me (nRF24L01 continuously reading closed pipe) so I modified your code as follows: void loop() { uint8_t pipeNum; radio.startListening(); while (!radio....


3

firstly, the radio.write command is used for checking for the acknowledgement from the RX after the FIFOs are full for a single write. But radio.writefast will not wait for the acknowledgement from the RX and would continuously transmit the payload for a single write. Similarly for radio.startwrite and radio.startwritefast commands. Coming to the keeping ...


3

I have not used the RF24 libary, but below are the register settings that should be written during void setup() to use the ACK_PAYLOAD functionality (N.B. nRF24L01+ only, does not exist on nRF24L01. Check you are using the right version of the radio!) TX: 0x00 CONFIG = PTX mode 0x0B RX_PW_P0 = Number of data bytes in pipe 0 0x1C DYNPD = 0x01. Enable ...


Only top voted, non community-wiki answers of a minimum length are eligible