Correcting falsehoods in tech documentation, lessons learned

MRF24J40 with arduino (teensyduino)

Earlier, I’d been working in pure C land, but I know not everyone uses pure C, and sometimes, the arduino environment is a nice easy way to get something prototyped.

So, I turned my mrf24j40 library into an arduino library! It supports all the basic stuff for sending and receiving 802.15.4 frames in a non-beacon network. It’s been tested so far with teensyduino, but it doesn’t use any teensy specific features, so it should work just fine on any arduino style board that has SPI and three spare pins for the reset, interrupt and chip select pins.

You can get the library from github, and like any arduino library, just extract it into your arduino/libraries directory. There are examples for tx only, rx only, and two way data.

hi im having the same problem too , im using the arduino nano and when i tried the object initialization in functions it works but gives output as 0 if i try to read the pan , if u have solved the problem please let me know

First of all, thanks for the library! I’ve got my two boards communicating, but I’m having trouble with the data part. I can see where to put in the data for the transmitting side, but the receiving end spits out hex data, rather than the ascii that is sent. Any ideas on how to convert it? Also, in the examples, they all have the same address(0x6001), but the transmit code sends to a different address (0x4202). Is this intentional, or should the RX board have the 0x4202 address?
Thanks.

The examples are for one node. You would need to change these for the “other” node. ie, the examples are all programmed to Node A (address 0x6001) and are expected to be communicating with Node B (address 0x4202)

As for the hex vs ascii, that’s all up to you. Line 81 in Basic_TwoWay just loops through all the received data, and prints it as hex. If you want that be interpreted as some other format, that’s all up to you. Those sorts of places are where I really expect you to put your own code in.

hello Karlp,
thanks for this library,
I’m using this library for my MRF24J40MA with arduino.I ‘ve seen your library source code but I ‘ve not found which function can be used to transfer data (such as: int, float…) between them.

Now I want to set up a sensor network between 5 modules. 1 is coordinator, 1 is router and 3 are end device with Security.
But I found it’s difficulty to do that. May you continue to develope your library in the future (such as: Beacon, Encryption, communication between up to 2 modules…)? That will helps me many things. Because I’m not good at writting an Library and Zigbee is quite complicated …

Sr, I mean may you continue to develope your library? Or may you give me some advices for my project?

I wanna set up between 5 MRF24J40MA modules. (as I said above). But I got trouble when I tried to let 4 modules send data to another one.(my modules I wanna receive data has address: 0x6001, and 4 modules I told you send data to this address) I don’t know how to config for this one to receive data in an order. For example:

When I send char from 4 modules to this one. I wanna see in its Serial monitor in an order:

“Received from module 1
Received from module 2
Received from module 3…”

But all I got in the serial monitor are not in an order and sometimes I got some error characters, even I’ve try to add delay function for each module after send data code (module 1: delay(500), module 2: delay(1000),module 3: delay(1500)…) :

“Received from module 1
Received from modu@#$@
Received from module 2…”

Let me be clear. a) comments on a ~4 year old post are _not_ the way to have a discussion, let alone get help. b) I’m not planning _any_ further work on this library, but if people send a pull request, I’ll consider merging it if it comes with clear explanations and test methods. c) I’m not interested in developing your mesh network application. d) using delay(hundreds of milliseconds) is going to _trash_ network reception. If you expect to be able to program in blocking delays with any sort of network interface you are sorely mistaken, and will continue to have pain and suffering until you stop that.