All HC-12 are initialised at Power-On, with "AT+P8" ... and "AT+C064". (100mW @ 458.06MHz). I came to conclusion that this combination is
probably OK for the UK...
...all other settings are left as default.
Data-wise, a remote node sends the following:
<lf>*U*U* ... pause 80mS ... <data>
Because the Receiver was designed around an interrupt condition of the STATE pin of an HC-05 going high, I reworked it to generate an interrupt when the Receive data line goes low instead. The <lf> is just for formatting on my debug receiver (when present) and the "*U*U* " was a bit of 'conditioning' that I thought might help. In practice, the <linefeed> is enough to wake the other end up by itself. The 80mS gives the receiver time to enter the ISR and post a 'serin' for the rest of the data. It waits for a prefix of "START ", and has a timeout label configured.
Typical data looks like this:
START 3,984,0,300,1,P,180,45<cr> (There's a node number, a temperature, voltage, sequence number, node-type etc). The 'serout & serin' make use of the "#" processing, to perform the ASCII to binary conversions.
When the read completes, there is at least a 10mS delay, before it posts back its response. (i.e. there's
some processing, then a 'pause 10mS').
The reply is in a similar vein, but there is no need to wake the other end up - by now, it's sat on a 'serin', with a qualifier of "REPLY "...
<lf>REPLY 1088,1072,1072,1072,1072,1088,180,45<cr> (These are my six thermostat 'Setpoints', and something to identify who the message was intended for)
I've just used the 'spring' on the HC-12, accepting that it may well be sized for 433MHz, rather than 458MHz. I've not had any issues with the units being too close together ... there are currently three sat on my workbench about 35cm apart. Even at 100mW, they seem perfectly happy.
I did have an issue with a poorly designed PCB though: see my post on
Page 11 of this thread.
Just to add:
I have one of the
'USB' HC-12 modules plugged into a PC, and find it really useful for monitoring the data-flow. (Using Putty/Realterm etc).