I need code for Arduino Mega 2560 with ENC28J60 ethernet module and NRF24L01 RF module.
Very simple task of joining your existing and tested code.
Please do not bid on this project unless you know what you are doing and have experience with these modules.
The project consists of 2 units ( unit 1 = ethernet and RF, unit 2 = RF only ).
The code must be the same sketch for both units. Unit 1 will have input pin 23 = HIGH, and Unit 2 will be 23 = LOW.
Coder needs to specify exact pins connections ( external [url removed, login to view] with common ground is available ).
Create a typedef :
int c1; // command 1
int c2; // command 2
long L1; // result 1
long L2; // result 2
int Ev; // Ev Number
long mType; // mType = 1 = new message so send back ping, mType = 2 = this is a ping reply
On Unit 1 :
Ethernet module ( set static IP to [url removed, login to view] ) must connect to local PC ( runs Xampp ) IP [url removed, login to view] gateway [url removed, login to view] subnet 255.255.255.0.
Server code to watch for incoming connections from PC browser, and display html page ( html code of what I want shown will be supplied ).
Also watch for keywords in the incoming request ( eg 'DoAction001' ) and make space for an action to be add at a later date ( for now, just [url removed, login to view] the keyword ).
'Activate' button is input pin 39. Internal pull-up ON
Unit 1 :
On 'Activate' = LOW, do 2 tasks :
connect to the server ( [url removed, login to view] ) and send a GET command :
[url removed, login to view]
( replace xx1_xx2_xx3 with the data from the typedef )
( php code is already operational and receives GET data and saves to a txt file - you do not need to do any php coding )
Send the typedef data to Unit 2 using the RF module.
Set mType = 1 to show it is a new message.
When Unit 2 receives the data, it must change mType to '2' and send the typedef back to unit 1 ( to confirm the data was received ).
Unit 1 must listen for the reply and check that the sent data equals the returned data. If not, then retry up to xx times.
Unit 2 must receive the typedef data, and individually [url removed, login to view] each variable in the typedef. I will add code later to do tasks with the variables.
On unit 2, when the 'Activate' is LOW, then do the following :
Change the typedef variable 'Sm' to the current millis(), set mType = 1, and send the typedef to Unit 1.
Wait for unit 1 to change the mType = 2 and return the typedef to unit 2 to confirm that unit 1 received the typedef. Retry up to xx times if not successful.
9 freelancere byder i gennemsnit $506 for dette job
I have experience with NRF24L01/+ I have made various applications with them. I can make the code for the Arduino and complete this project on time. Please message me if you like my offer.