Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:16 26 Oct 2021 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : New HC12 modules...

     Page 1 of 2    
Author Message
Grogster

Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 7700
Posted: 02:53am 12 Feb 2019
Copy link to clipboard 
Print this post

Hi all.

These are the latest module from hc01.







The new one is on the top, the old one is on the bottom.
Both the old and the new operate exactly the same, as you would expect - and are perfectly on frequency.
The most obvious change is that the SSOP has been changed for a QFN package.

This does, however, make it very easy to now spot the difference between the old and the new models, and genuine ones will have the QFN package on them - for now, until the cloners clone the latest model. I would expect that to take a little time though, so for right now....

RossW helped me get this batch, so my thanks to him.
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 12:16am 13 Feb 2019
Copy link to clipboard 
Print this post

I see the new one has some more caps probably for decoupling. The QFN version might be a bit more reliable.
Microblocks. Build with logic.
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 346
Posted: 01:04pm 15 Feb 2019
Copy link to clipboard 
Print this post


Looks like the clones are already out there.

front view



back view


 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1633
Posted: 01:13pm 15 Feb 2019
Copy link to clipboard 
Print this post

great
 
Grogster

Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 7700
Posted: 04:02am 16 Feb 2019
Copy link to clipboard 
Print this post

Damn. I was not expecting them that quickly. The only way you can be sure, is to test each and every one for frequency accuracy, or buy direct from hc01 or the resellers.
Smoke makes things work. When the smoke gets out, it stops!
 
LadyN

Guru

Joined: 26/01/2019
Location: United States
Posts: 408
Posted: 06:55pm 18 Feb 2019
Copy link to clipboard 
Print this post

Hello! It's awesome to see this module on this forums!

I'm interested in using these as a way to poll data from sensors at our farm over a 300 feet radius as V0 prototype.

How is the range going to be in a rural area?

We are not in the city but in a farm.

The first prototype will service around a 2 acre test plot to keep things small and simple.

We have metal sheds here and there. Certain crops have mesh and netting overlaid metal frames.

I am thinking of using a few of these and hooking them up to either a BluePill or ESP32 both running Arduino

Should I buy any special antennas to ensure range?

Reliability is the key and it's OK if I have to use a transport layer over software to achieve message reliability if these links are not super reliable as long as they can provide the range needed.
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 733
Posted: 01:29am 19 Feb 2019
Copy link to clipboard 
Print this post

Hi Natasha,

Range shouldn't be any problem at all out in the boondocks away from RF noise. The only thing that can mess you up is a noisy power line or pole transformer. I grew up on a 1500 acre dairy farm in the western Catskill mountains. It was amazing how far 100 mw would carry! The metal sheds and corn cribs might provide some strange ground plains, but moving the transmitter a few feet should find a sweet spot.

Paul in NY.
 
Grogster

Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 7700
Posted: 02:37am 19 Feb 2019
Copy link to clipboard 
Print this post

@ LadyN:

Agree with what Paul just posted.

I have used hundreds of these modules, and the GENUINE ones are fantastic. The clones are off-frequency and also have sub-standard modulation, both of which seems to be cos the clones use reject crystals that are not to spec.

The clones and the genuine ones WON'T co-operate in the same network, as the 38kHz frequency error on the clones, makes them deaf as a post to the genuine on-frequency signals. And vise-versa.

As to range, they work exceptionally well in FU4 mode at 1200 baud. This is the mode that will give you the best range, but the lowest baud-rate. For short data packets, that is not normally a problem.

I can easily get 300-meters or so between modules just with the little helicals, and that is with one node inside, so that figure is through walls, trees and other vegetation, and other buildings. Better aerials give better performance.

I can easily get about 2km of range(through objects), if you couple up the receiving end to a TV booster amplifier, as 400MHz is right in the UHF range of most TV booster amps. I used a TV booster amp with 15dB UHF gain, and put the roof antenna into the amp, and the output of the amp into the HC12. I was just about knocked off my feet at just how far you could get on that arrangement.....
Smoke makes things work. When the smoke gets out, it stops!
 
LadyN

Guru

Joined: 26/01/2019
Location: United States
Posts: 408
Posted: 07:08pm 19 Feb 2019
Copy link to clipboard 
Print this post

What's a good way to locate genuine HC-12s?

Is there a specific seller on Ali?

Are they more expensive than the typical ~$3 I see for HC-12s on Ali?

If you have some links to genuine sellers, I will place a few orders

THANK YOU!
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1633
Posted: 08:10pm 19 Feb 2019
Copy link to clipboard 
Print this post

Grogster ended up getting in touch with HC01 directly courtesy of a little help with the chinese translation on the web site... got a tray of genuine ones I seem to remember...

This link gives more background info
https://www.thebackshed.com/forum/forum_posts.asp?TID=10443&PN=1&TPN=1
 
LadyN

Guru

Joined: 26/01/2019
Location: United States
Posts: 408
Posted: 09:31pm 19 Feb 2019
Copy link to clipboard 
Print this post

You all are wonderful! (and Thank you Andrew for the link!)

Let me see if I got this right:

1. A new batch of HC-12s came out with QFN packaging and we were hoping that would be an easy way to separate the genuines from the clones
2. However, the newer clones are also using QFN packaging so it's again not possible to separate the genuines from the clones
3. The reason why we want to separate the genuines from the clones is because they are off by a certain freq. due to the tolerance of components used
4. As a result, genuines work well with each other (by design) and clones work well with each other (by chance) but genuines won't work well with clones

Did I get this right?

If so, I have these questions:

i. Are clones off due to tolerance of components used
ii. ... or do the clones use a different set of parts altogether that are not the same as the genuines (I think I saw someone mention the XTAL was different but I can't locate that anymore)
iii. Are clones extremely compatible with each other (as long as we stay within the same year of clones (clones produced in 2019 work well with each other but might not interface with clones produced in 2018))
iv. Is there any change in software/firmware/driver that needs to happen when using clones vs. genuines or they are all plug and play (although the radio freq. might not be compatible)
v. Has there been any work done on making a mesh network or a 1:n broadcast network using these modules? (it seems right now they are pretty much 1:1)
 
Grogster

Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 7700
Posted: 10:59pm 19 Feb 2019
Copy link to clipboard 
Print this post

Correct on all four points.

Re your questions:

1) Mainly it seems to be sub-standard or reject crystals that cause all the problems. They are quite badly off spec in both frequency and the modulation level you get from them. See the other thread that CaptainBoing linked to. It is long, but it goes through all the issues, and includes evidence of the crystal issue, kindly provided by the member of another forum who allowed me to post his scope image comparing the two.

Some members here have replaced the reject crystal with a genuine crystal, and then the clone units work exactly as expected. The problem is, for a $5 module, it is not worth the effort required to remove the bad crystal and replace it with a good one.

2) With clones, ANYTHING is possible. I fully expect that MCU and the RF chip are clones of the originals, and that all the passives are sourced from the cheapest supplier they can find. This would explain why the crystal is so far off what it should be, and the caps and resistors could be also. You'd have to dissect a clone module, and measure each and every passive part and compare to an original, but no-one has the time to do that.

3) Yes and no. I would be inclined to say: "Not necessarily." This is because there is essentially zero quality control with clones, so while it IS true that clones within one batch seem to work fine with each other, that is not to say that mixing modules from different batches of clones would work - you might end up with a similar problem. Solution: Avoid the clones like the plague.

4) No. The clones seem to work OK as clones, in a network of clones, as far as has been tested. They respond to the same commands, and do the same thing - just not on frequency as the genuine ones are. I actually have a tin with all the detected clones now in it, and I still plan to use these for my own automation projects, as I know they work OK with each other, but I just can't use them to add into a network of genuine ones, as they are deaf as a post.

5) No. Not that I am aware of. They do not support the MESH protocol, so that pretty much, is that. I use most of mine in a n:1 arrangement, where there are heaps of nodes, any of which can talk back to one module being used as a master receiver. That works just fine. You could also have the master transmit and it would be received by ALL nodes at once, or you could have node-specific addressing in the code. The module does not care, and it is just a 'serial-in-serial-out' wireless link situation as far as the modules themselves are concerned.

Hope that helps a little, and is not clear as mud.
Smoke makes things work. When the smoke gets out, it stops!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1730
Posted: 11:02pm 19 Feb 2019
Copy link to clipboard 
Print this post

Basically, don't use clones. They are not compatible with genuine, one batch is not necessarily compatible with another, and even if compatible they are not likely to have the range and perhaps glitch-free-ness of the genuines.

Grogster sells good ones: https://www.rictech.nz/everything-else

 
LadyN

Guru

Joined: 26/01/2019
Location: United States
Posts: 408
Posted: 11:25pm 19 Feb 2019
Copy link to clipboard 
Print this post

Grogster,

thank you very much for reading my long post.

To summarize, the clones use cheap components and the only reason they work with each other is due to chance.

Due to inferior components, they might even drift over time causing an unreliable link.

The guaranteed way of getting these links to work reliably is to:

1. source them from the OEM HC01
2. ... or to purchase them from people like you who placed the MOQ order with HC01 and resell them because they did an exhaustive study of the HC12 on the market and realized that sourcing them from the OEM HC01 was really the only cost effective way to proceed.
3. ... or replace passive components and the XTAL with components of OEM quality to bring them back to spec

Why does HC01 not sell on Ali/eBay?
 
Grogster

Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 7700
Posted: 11:40pm 19 Feb 2019
Copy link to clipboard 
Print this post

Hiya.

Yes, in a nutshell, you have it.

I also wish hc01 would sell on AliExpress or eBay, but they simply choose not to.
It is a shame, as if they did, I expect everyone with knowledge of this issue, would choose to purchase directly from them.

It could be as simple as the fact that they don't want to have to deal with heaps of orders for a couple modules each. Processing and sending off heaps of orders for a module or two, takes a lot of time, and time is money.

Many of the HC12's I have previously purchased from eBay or AliExpress sellers had been genuine ones that were being on-sold, but once the clones arrived on the market, they tend to flood the market, and then it becomes very hard to detect the genuine ones.

If a seller is offering them very cheaply - $2 or so each - you can just about guarantee they are clones. But the problem with clones, is that honest sellers can end up selling them, not realizing they are clones, if they don't themselves source them from hc01.
Smoke makes things work. When the smoke gets out, it stops!
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1633
Posted: 08:37am 20 Feb 2019
Copy link to clipboard 
Print this post

  LadyN said  
<snip>
v. Has there been any work done on making a mesh network or a 1:n broadcast network using these modules? (it seems right now they are pretty much 1:1)


do you mean generally or as an attempt to get the dodgy ones working with good ones?

If the latter, forget it. The dodgy ones seem to play nice with each other but that is only until the next batch.

On the former subject, I think several people have played with star-based networks with them. I certainly have and I have three installations (37 devices total) running at a few snooker clubs, remotely turning the table lights on and some feedback pods in the loos. They all use HC-12s and a module plugged in the back of a PC functions as the master node (address 000) at each site. In theory you could have up 997 slave nodes on a single channel and it is easily expandable if a thousand nodes isn't enough

This wiki shows some of my early working on the protocol and some working code (some VB6 is in the attachments if you want to play) - it is a bit old now but will give you the idea and this YT vid shows three nodes (two breadboard Mk2s and an MMX) all talking to my laptop. I was paid to write it specifically so I can't post the "real" code as it effectively belongs to someone else. The install was really easy, I managed to find some large ceiling roses for the light power outlet that I could get a tiny mains PSU, a small MM controller and a SSR in so it was just a matter of changing the ceiling rose over each table. There is a 3.5mm jack socket in the side where you plug in to talk to the controller, each needs an address and a purpose at first-light but after that they just work. And due to the auto-discovery of the network by the master it all auto configures when a slave is discovered. I have had one problem in 16 months - a dead PSU. Bypass is achieved by software - turning the power off (the original light switches still exist behind the bar - zero wiring changes!) so power off/on bounces the controller and by default it activates it's SSR until discovered. The upshot is that everything works like it used to before automation by using the switches behind the bar... a fact not lost on some of the locals who want free table time but the controller will tell tales when it next chats to the master, "UNXR305" = unexpected restart 305Sec ago etc...

HC-12s work really well in this configuration, I was amazed (and pleased) to find how really easy it all was. The network employs encryption but I found the smaller Mk2s had trouble keeping up with industrial strength RC4 (the cycle time is 1.5 seconds, 2 with a stretch and to receive, decrypt, work out what is needed, encrypt and transmit was too tight for comfort). So I opted for a simple symmetrical XOR, byte/byte encrypt with a shared key, which is much faster. The data is not really "interesting", but it is good practice not to have open networks. One "thing" - because all the nodes are on the same channel, every node receives and decrypts every message before they can decide whether they are involved or not (MyAddress or Broadcast). Small pin-prick of excitement in the day of an otherwise, largely bored controller

The PC-based master saves it's discovery data periodically (and when shutdown nicely) so the next day you get a "fast re-heat" of the network topology and don't have to wait for a complete discovery, although discovery is continuous only known nodes get serviced quickly. There are a few message queues and the master services those so "urgent" stuff gets priority... you could be polling just normally, interspersed with discovery attempts way up in the network addresses, someone asks for a light to go on and that message will jump to the head of the queue and be serviced in, worst case, 3(ish) seconds. All of this goes towards metering of tables.

my 2p

this might help
Edited by CaptainBoing 2019-02-21
 
LadyN

Guru

Joined: 26/01/2019
Location: United States
Posts: 408
Posted: 08:22pm 20 Feb 2019
Copy link to clipboard 
Print this post

That is very useful information.

I am already sold on not using cheap clones hence my previous (and future) questions do not include them as a component.

I did want to ask and clarify what a star based network in this scenario is?

Does it mean:

1. The "remote" nodes talk directly with the "central" controller and there's a bidirectional communication between each path (but "remote" nodes don't talk to each other directly)?
2. Or, in addition to the above, the "remote" nodes also talk to each other?

So #1 looks like a starfish if drawn out and #2 looks like the star of david if drawn out

By "mesh" I mean #2.

This would be very useful to me because due to environmental/interference reasons a few "remote" nodes might not be able to contact the "central" controller now and then but their information get relayed to the "central" controller by other nodes that can contact the "central" controller.

It's ok if the HC12 does not natively support this. I am happy to use a software solution.

Please excuse my ignorance with these terms.

I am learning as fast as I can and all of you have been very helpful but this is the first time I am thinking about networked nodes so I am surely using improper terminology and my thoughts are of low quality and half baked.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 2503
Posted: 11:55pm 20 Feb 2019
Copy link to clipboard 
Print this post

Star would be where the centre talks to each of the others and they talk only to the centre.

John
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1633
Posted: 09:48am 21 Feb 2019
Copy link to clipboard 
Print this post

  LadyN said  
I did want to ask and clarify what a star based network in this scenario is?

Does it mean:

1. The "remote" nodes talk directly with the "central" controller and there's a bidirectional communication between each path (but "remote" nodes don't talk to each other directly)?
2. Or, in addition to the above, the "remote" nodes also talk to each other?

So #1 looks like a starfish if drawn out and #2 looks like the star of david if drawn out

By "mesh" I mean #2.

This would be very useful to me because due to environmental/interference reasons a few "remote" nodes might not be able to contact the "central" controller now and then but their information get relayed to the "central" controller by other nodes that can contact the "central" controller.

It's ok if the HC12 does not natively support this. I am happy to use a software solution.

Please excuse my ignorance with these terms.

I am learning as fast as I can and all of you have been very helpful but this is the first time I am thinking about networked nodes so I am surely using improper terminology and my thoughts are of low quality and half baked.


you pose good questions and never be worried about showing a lack of knowledge in asking - no-one was born knowing everything and I have yet to meet an expert that doesn't own heaps of books on their pet subject, so ask away.

OK, I see what you mean between mesh and star. The example I gave above definitely uses a star. There is a "central" controller node (master) which initiates communication and no slave may start it. They all monitor the network waiting for their name to be called but stay silent unless that happens - remember this is not a technological feature of HC-12s but down to the protocol you devise and then encode in your own software. without a hint of mean-ness, HC-12s are quite dumb devices and just do what they are told - this is a major strength because all devices on a single channel just have a seamless access to a universal "surface" and can see what is going on.

A mesh as you define it is totally possible... it would be quite tricky because you need to mitigate collisions etc. The HC-12s have a pretty smart controller that handles all the radios (preamble etc) but I don't know what level of auto-retry and collision detect they have - I suspect little to none, which is not a negative in my view - I am far happier writing all that stuff myself knowing I wont be fighting with the hardware coz it is doing things behind my back trying to be helpful. As ever you want the system to be super stupid or super smart - if the latter then consider WiFi as that does have retry and mitigation in the event of packets walking all over each other. There are several devices that will get you going for that and I think if I was after a mesh I would be playing with ESPs devices... they are very good. I have used a few ESP8266 and I wrote a (fairly rough 'n' ready) module for working with them (as an addition to any prog) which you can browse here: http://www.fruitoftheshed.com/MMBasic.ESP8266-Module-with-HTTP-API.ashx . The 8266 is getting old now and newer devices like the ESP32 have a great report in the press. Of course being WiFi there is a degree of complexity you have to handle - unlike HC-12s. The latter also has a markedly better range than WiFi if you use it's highest power setting.

If you want to reach devices beyond range, you could do it transparently by having HC-12s back-to-back but on different channels... a small repeater would consist of two HC-12's and a PSU, nothing more. On the master end you could be, say, on channel 1 and the remote would be on say, channel 4. The two HC-12s would have their Rx/Tx lines crossed over and one on each channel. There would be a tiny delay introduced but that would work.



Would 2 miles of reach solve your problem? A star network is very much simpler to do. Similar blind spots would need a repeater but set the slave and secondary in the repeater to a different channel say 8 for good separation. Transmission windows (master -> slave, wait for reply etc...) would need to be opened out a tiny bit to allow for the relay to do its thing.

Although the repeater could be implemented with laughable simplicity, I might be tempted to put a micro-controller between them and relay through it because then you could make a standard unit with some switches on the outside to set the channels and the controller would read those and send the relevant AT codes to the HC-12s to alter their settings... but only if I wanted the repeater to be a standard unit I could drop in anywhere in any number... if I needed just a handful, it would be exactly as shown above. No point going to manufacture on just a tiny run that is easily achieved without it.

Edited by CaptainBoing 2019-02-22
 
LadyN

Guru

Joined: 26/01/2019
Location: United States
Posts: 408
Posted: 06:55pm 21 Feb 2019
Copy link to clipboard 
Print this post

I am really HAPPY to see the support from you all as well as the continued mentoring. I will be following HC12 threads with interest. THANK YOU!
 
     Page 1 of 2    
Print this page
© JAQ Software 2021