I will read your thread and code in more detail to come up to speed with your topic.
It does look like you will have to negotiate a tightrope with these modules. I think you will need to create your own packet protocol.
I would go back to grass root basics and construct a hard coded message, remove all code not associated with basic message delivery, and work on receiving that successfully and then work back up to the whistles and bells.
- Code:
E.g.
//preamble - send preamble 0x51 for minimum of 30ms
starttime = millis();
endtime = starttime;
While ((endtime - starttime) <=40) // do this loop for min 30mS
{
Serial.write(0x51);
endtime = millis();
}
Serial.write(0xFF); // FF start framing bit
Serial.write(0x00); //
byte message[] = {0x93, 0x95, 0x8E, 0x8E, 0x99 }; // msg=SUNNY
Serial.write(message, 5));
A couple of initial observations
- Have you initialised the modules? Are they on the same channel/frequency?
- Have you spotted that you can only TX a subset of 66 useable values. Values from 0-255 where the binary equivalent has a balanced number of 1's and 0's (4 of each)
- I see you send the preamble of 55h 6 times - does the meet the required duration of 30ms from TXE transition
- You cannot use message start 0x21 ascii ! (b100001) or messager end 0x23 ascii # (b100011) - see valid 60 binary patterns (4 zero's and 4 one's)
I spotted several other things but cannot recall them now as I type this - will update you later
I am tempted to buy a couple of units... I have a call out for them to ring me back...
Update: - Have you seen the Radiometrix Narrow band Evaluation Kit (NBEK) IC. Looks like this is a chip that handles the preamble & framing - from what I can see you can use one both ends and then you end up with a traditional 1200 Baud Modem radio link that you can plug into. Not sure this is compatible with 4kbps LMT0 as it states > >5kbps data rate. I guess a call to the Radiometrix mothership would confirm ...
http://www.radiometrix.com/content/nbek-ic
I have scanned the net and not found any code Arduino code examples or libraries that have been written for this module - maybe Radiometrix have a code shell - looks likely when you read the PDF file "Your data over a simple radio link" as it has everything apart from the code :(
http://www.radiometrix.com/files/additional/your-data-over-a-simple-radio-link.pdf
Regards
Jonathan
Lucky 66 :) - binary codes with "balanced" 4 x Zero & 4 x One digits
Extract from Your data over a simple radio link
Then, to maintain mark:space balance, data can be sent by using only those characters with an equal number of ones and zeros in them.
Of the 256 possible 8 bit codes, 70 contain 4 ones & 4 zeros.
Omitting 0Fh, F0h, 3Ch and C3h (worst case ‘four ones in a row’ bit sequences) still leaves 66 usable codes per byte, which allows six bits of actual data to be coded into each transmitted byte.
(A full explanation of this method can be found here: http://www.radiometrix.co.uk/products/bimsheet.htm#rs232) - invalid URL
Tue Oct 29, 2024 4:46 pm by tsenecal
» RC Drift Gyro for pitch control
Sun Oct 20, 2024 2:04 pm by geofrancis
» WW2 mini sub build
Thu Oct 17, 2024 2:34 pm by geofrancis
» sonar data link
Mon Oct 14, 2024 4:31 pm by geofrancis
» Robbe Seawolf V2
Sat Oct 12, 2024 3:52 pm by geofrancis
» ExpressLRS - 868/915 Mhz equipment
Fri Oct 11, 2024 8:58 pm by Marylandradiosailor
» Flight controllers as sub levelers
Fri Oct 11, 2024 8:14 pm by geofrancis
» 868/915 Mhz as a viable frequency for submarines.
Thu Oct 10, 2024 3:21 am by tsenecal
» Microgyro pitch controller corrosion
Wed Oct 02, 2024 11:32 am by geofrancis