RFM12B_simple

https://github.com/openenergymonitor/RFM12B_Simple

according to above, i have upload the sketch of Tx to my emontx shield on arduino board, and sketch of Rx to my new bought pre-assembled nanodeFR SMT 433Mhz, i open the serial monitor of Tx , i saw there are something like power1,power2 with values printed out on the screen(donnot know where the value comes from since i have not attached any current sensor yet). but there is nothing displayed in the serial monitor of Rx.

chunyang's picture

Re: RFM12B_simple

continue with previous question, which board do i select while i am uploading the sketch to nanodeRF SMT board? (arduino ethernet is the correct one )?

calypso_rae's picture

Re: RFM12B_simple

chunyang: Sorry, I've not used these sketches from Github. 

My own pair of RF checker sketches are simpler because they only use the Jeelib library, nothing else.  I posted details of them a couple of days ago on another thread.   If you were to try using these, then I may be able to help you (but I can't make any promise of success!)

I have always set the Board type to Arduino Uno.  That works for the emonTx.  If it needs to be different for the nanodeRF, I would expect this information to be highlighted in the relevant documentation (which I've not checked because I've never used a nanodeRF)

[No it doesn't, Uno is correct - RW]

chunyang's picture

Re: RFM12B_simple

so what is your Rx used for? isnt it for nanodeRF?

i have quickly tried your code both yellow LED stays on instead of flashing.. is that correct?

Robert Wall's picture

Re: RFM12B_simple

First, you need to set the RF frequency in both Tx and Rx sketches to suit the RF modules that you are using. Both must be the same.
Next, set the LEDPIN in both Tx and Rx sketches to suit a LED - it doesn't matter which if you have more than one, and they may be different in the Rx and the Tx.

The Tx sketch switches the LED on for 0.5 s and off for 1.5 s, and repeats this forever. When it switches the LED on, it sends an "ON" message, and when it switches the LED off, it sends an "OFF" message.

The Rx sketch listens for messages and when it sees the ON message, it switches the LED on, and when it sees the OFF message, it switches the LED off.

That's all it does. If both LEDs do not flash together, something is not working. You need to see what happens and relate that to the code listing in the sketch to see where the problem lies.

You can use the each sketch in emonTx, emonGLCD or NanodeRF. All 3 nodes will both transmit and receive.

 

calypso_rae's picture

Re: RFM12B_simple

chunyang: so what is your Rx used for? isnt it for nanodeRF?

No, I've never used a nanodeRF because I don't want to send data to emonCMS.  The reason why I sometimes use an RF link is in connection with my Mk2 PV Router design.

As Robert has said, you need to look inside these sketches and make sure that all of the relevant parameters have been correctly set up for the hardware that you are using.  If everything is not working for you, then try to find some part of your system that is working and gradually develop this into your intended design.  Not many of us get our systems right first time.  We have to work out for ourselves how these things are supposed to work, then find out what is wrong with our own builds, and gradually make progress.  

This forum is a great place to exchange ideas, but sometimes you have to figure out for yourself what's going on.  No-one else can do that for you, however hard we may try.

 

chunyang's picture

Re: RFM12B_simple

i think everthing is set up properly, i have tried the g_transmitting data from the guide of emontxfirmware for my emontxshield based on arduino and fixedpacket for my nanodRF SMT  but nothing displayed on both serial monitor

 so the sketch "g_transmitting data" works for emontx shield right?

 

Robert Wall's picture

Re: RFM12B_simple

Does it say "emonTx" or "emonTx Shield"? If it says emonTx Shield, it is for the emonTx Shield. If it says emonTx, it is for the emonTx.

chunyang's picture

Re: RFM12B_simple

i found the transmitting sketch in the sub-folder "guide" which in the folder emontx_firmware

chunyang's picture

Re: RFM12B_simple

so which sketch that i can use to test the wireless connection is built up between the base station and the emontxshield? i dont know the sketch for emonTX would be also working for the emontx shield?

https://github.com/openenergymonitor/RFM12B_Simple

this is the sketch provided on the webpage of introduction about FRM12B and it is used for testing the connection. 

i followed the steps introduced on the emontxshield page, like soldering the two jumper pins and update the sketch in RF12.cpp  and still not displaying anything in the serial monitor of the emonbase

Robert Wall's picture

Re: RFM12B_simple

Get the circuit diagrams for the emonTx and the emonTx shield. Compare them, and if you really want to use the emonTx examples for the shield, you must change the parts of the sketch according to the differences between the two pieces of hardware.

Are you using the same hardware as in the thread here?

chunyang's picture

Re: RFM12B_simple

i have never used emontx, always use the shield on the arduino board. 

and i have followed the soldering steps of RFM12B for the shield

and i dont know that i am using the correct sketch 

https://github.com/openenergymonitor/RFM12B_Simple

i found on the webpage of RFM12B for testing the connection

i am really suffered in the wireless connection thing, plz let me know first that i am using the correct sketch for the shield to test the connection, if not, which sketch i should use for testing the connection. really appreciate

calypso_rae's picture

Re: RFM12B_simple

chunyang, the emonTx Shield does not have a processor so it cannot run a sketch.  Any Tx sketch that you are using must be loaded into your Arduino Uno.   When running a RF test sketch (either Glyn's or mine) the only component that the emonTx Shield is providing is the RF chip.

Can you tell us about anything that is working for you?  A scanned drawing would be really helpful.  Then we may be able to help you with the parts that have not yet been sorted out.

 

chunyang's picture

Re: RFM12B_simple

what i want to do is just transmit the data from my emontxshield on the arduino board to the nanodeRF SMT and displayed on the computer. and i am running the sketch which i am sure it is just for emontx or for both emontx and emontx shield. so far the wireless connection cannnot be set up. 

so do you know which sketck i  should use for building up the wireless connection between the emontx shield( on arduino board, yes i know i upload the code to the board not the shield)?

so far i have tried three sets of sketchs which are not all working for me 

calypso_rae's picture

Re: RFM12B_simple

chunyang: Yes, I do understand what you are wanting to do, you want to get your RF link to work.   If I were in your position, I would use my two RF checker sketches for this.  RF_checker_tx,ino needs to be running on your Arduino, and RF_checker_rx needs to be running on your nanodeRF.  

You need to check that all the basic settings are correct, such as which pins your LEDs are driven from.

If it's all not working, you need to step back and find something that does work.  For example, you could try running the example sketch blink.ino on each of these platforms to check that your local LEDs do actually operate as intended.  Once you've demonstrated that both hardware platforms are OK, you will then have more confidence in your setup. 

Simply trying lots of different sketches is unlikely to solve your problem.  You need to find something which works, and we can take it from there ...

 

chunyang's picture

Re: RFM12B_simple

so far i have figured out the transmitting demo sketch, so i think nothing is wrong with the shield and nanode SMT.

but when i took the actual test for power measurement, i used the  sketch of  nanodeRF_coms  as my receiver code, there is nothing displayed in the serial monitor

 

calypso_rae's picture

Re: RFM12B_simple

Until you can get your RF link to work, there seems no point in running the "official" nanodeRF sketch.  On your nanodeRF, you should be running the Rx part of the RF checker pair, either mine or Glynn's from Github. 

The first thing that you need to chcek is that the LED at your transmit end is flashing on and off.  On your Arduino, this will presumably be  at pin 13.  You may need to modify the Tx sketch to use this pin.  If it's not working, maybe you could try with the example sketch blink.ino.

At the receiving end, you have a nanodeRF which runs the same kind of sketches as an Arduino.  You might want to run blink.ino there too, so that you know which pin the LED is on.  Or you could use the Serial Monitor to see what is happening.  When you have both parts of the RF checker running at the same time, something should be happening at the Nanode in sync with the LED that's flashing on your Uno. 

Once you have got the RF checker sketches to work, sending your data across the RF link should be easy :-)

chunyang's picture

Re: RFM12B_simple

as what i mentioned before, i am able to transmit the data from the shield to the nanode board by running demo sketch provided on the website. so both my shield and nanode board is both working good. but now i am trying to measure power and transmit the measured data to the nanode board.

therefore at transmit end, i run the sketch of " emonTxshield_cT1234_voltage" and at receiver end i run the sketch of "nanodeRF_cosm". in the serial monitor of receiver or "nanodeRF_cosm" i am expecting something should be displayed, but there is nothing 

calypso_rae's picture

Re: RFM12B_simple

Are you able to get the two LEDs flashing together, one on each board (Uno and nanode)?  This will prove that your RF link is working (which is what this thread was started for). 

chunyang's picture

Re: RFM12B_simple

Yes the wireless connection is built successfully but when I try the measurement sketch it displayed nothing

calypso_rae's picture

Re: RFM12B_simple

If your radio connection is now working, then I'm very pleased to hear about it.  I wonder what you have changed in order to make it work? 

Your RF link was not working when you posted your first message in this thread.

 

chunyang's picture

Re: RFM12B_simple

First I did not solder the middle pad to left and pad 

second I should not change the code 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.