Configuring HC-12 USB Module? (slightly OT)

#1
After considerable success using HC-12 transceiver modules between PICAXE 28X2 chips, I am trying to configure one of the HC-12 modules with built in USB interface to connect the 433 data with my PC (VB app to be written at a later date). Refer to attached image.
HC-12_USB.JPG
The process seems simple enough. According to the supplier's webpages: If you want to modify parameters 433 wireless module, the user can hold down the button on the side of the module KEY, enter AT mode. Release the button after modifying the parameter KEY, AT mode module exit back to the serial pass-through mode."

My process:
  • Plug the module into a spare USB port on my PC.
  • Find the COM port allocated by Windows 10 (COM5)
  • Open PuTTY and create a serial session COM5:9600,8,1,N,XOn/XOff
  • Typing in the PuTTY terminal widow causes a yellow LED to flash inside the module, so I know I'm connected to the HC-12 module
  • I read that the HC-12 needs the characters in its commands to be in quick-fire fashion, so I have prepared several configuration commands in a text editor.
  • I then copy an AT+command to the PC's clipboard, hold the HC-12 module's button in and paste the command into PuTTY.
  • The echo I consistently get back in the PuTTY terminal is "ERROR". This tells me 3 things: (1) The HC-12 is in command mode; (2) The baud rate is correct and, sadly, (3) the command was not recognised.:mad:
So, to my question: Has any other forum member managed to configure one of these HC-12 USB modules?
 
#2
Ho hum! Perhaps one of the shortest threads on the forum :)

In PuTTY, <Control V> sends ASCII 22 (syn) to line. To paste text into the terminal window, I needed to right-click on the terminal screen. The HC-12 responds immediately with a positive acknowledgement.

So, pasting AT+C003 (with no <CR>/<LF>)
Gets the response OK+C003

All happy again.
 

hippy

Technical Support
Staff member
#4
In PuTTY, <Control V> sends ASCII 22 (syn) to line. To paste text into the terminal window, I needed to right-click on the terminal screen.
This is a common issue with any application program which communicates what's typed with something else, depends on whether the OS or app intercepts a particular key press or the app passes it along.

When an app passes it on there will usually be a menu or right click option as you found to do the pasting. Sometimes Shift-Insert or Ctrl-Insert may also do the job.
 

PhilHornby

Senior Member
#6
I have a couple of these, and they work as advertised, except: after a reboot, they often have the yellow led solidly illuminated ... and don't work until removed and re-inserted. No idea why :)
 

techElder

was Texasclodhopper
#7
This morning I discovered one of these HC-12-USB devices in my stash. I had forgotten that I got it with some other HC-12 stuff!

Of course it doesn't work when I plug it into a USB port on my PC. Sigh.

"Device driver software was not successfully installed." "HC USB Virtual COM Port X No driver found"

"HC USB Virtual COM Port" is listed under "Other devices" with the yellow "!".

Any clues on how I can find the correct driver for my Windows 7 PC?
 

hippy

Technical Support
Staff member
#8
Any clues on how I can find the correct driver for my Windows 7 PC?
Google or other search engine ?

Have a look for retailers who sell the device and they may indicate which drivers to use, may even provide those drivers.

In the device's Properties under Device Manager there should be a VID/PID for the USB which can usually help clarify/confirm which driver is needed.
 

techElder

was Texasclodhopper
#9
Google or other search engine ?

Have a look for retailers who sell the device and they may indicate which drivers to use, may even provide those drivers.

In the device's Properties under Device Manager there should be a VID/PID for the USB which can usually help clarify/confirm which driver is needed.
Been there; done that.

I did find a web site that was totally in Chinese. :D

VID/PID shows:

USB\VID_0482&PID_5740&REV_0200
USB\VID_0482&PID_5740
 
#10
Tex, Identical VID/PID and REV as my USB/HC-12. Attached is the driver details (my PC in Win10/64). The driver loaded automatically for me when I first plugged it in a few weeks ago.
HC-12 USB Driver.JPG
 
#12
Bend it to fit ...

"Device driver software was not successfully installed." "HC USB Virtual COM Port X No driver found" ... Any clues on how I can find the correct driver for my Windows 7 PC?
By strange coincidence, I went through this same process yesterday - getting one to work under Windows 7 on an old Samsung NC10. I could have sworn I'd had it working in the past, but apparently not!

The ID (of mine, at least) is VID_0482&PID_5740&REV_0200 - Google contributed nothing useful, other than lists of dubious "Driver Repair Kits", which are best avoided IMO. Vendor ID 0482 is Kyocera - and this is almost certainly not a Kyocera product!

On Windows 10, the device installs automatically and is identified as a "USB Serial Device". It uses the 11 year old, Microsoft provided, USBSER.SYS - which is also shipped with Windows 7, but as an even older version.

I don't know what the Windows 10 mechanism is, that allows it to identify the device as a generic USB Serial Port, but that mechanism is seemingly not present in Windows 7. I was about to embark on creating a .INF for it, when I had a change of heart and tried a shortcut - which worked...

Searching through all the .INFs (in C:\Windows\INF), I found a variety of devices that use USBSER.SYS. Rather than my usual technique of cloning one and adding the "Kyocera" VID and HC-USB identifier strings, I persuaded Windows 7 to just use one "as is". It complained that it couldn't be sure it would work - but it did :)

The one I picked was found in OEM72.INF - so it was something I've manually installed on the netbook in the past. It was listed as "MediaTek Inc." and supports the "Mediatek USB Port". I'm guessing this was intended to support a (ZTE?) Android phone.

To install it, I went through the "Update Driver" wizard. I picked "Browse my computer for driver software", then "Let me pick from a list of device drivers on my computer". Listed under "MediaTek Inc." was my "MediaTek USB Port", which I selected. This then triggered the Windows 7, "Don't blame us if this goes 'orribly wrong" message, which I chose to ignore. The result was a working (though oddly named) "MediaTek USB Port", that appears to work properly.

You probably don't have that particular Mediatek driver .INF - but you might find one of the others that works for you. (It takes some perseverance to find the chosen device in the list of 'drivers already on the computer'. I had a few false starts, where I ended up with something other than USBSER.SYS)

Have fun ;)
 

techElder

was Texasclodhopper
#13
He says with a perverse laugh heard across a great body of water! :D

Great information. After my breakfast, I'll dive in some more!

PS. The coincidence goes further in that I'm working on reworking your developmental HC-12 configuration code. More later.

Ain't life strange? :D
 
#15
Maybe just coincidence.
There's a lot of it about :)

VID_0483 appears to be STMicroelectronics - and I believe there's at least one STM chip on that USB 'dongle'. Entirely possible that someone mistyped, when they created it ...

One thing I'd forgotten, is that creating your own driver (.inf) triggers a whole load of new problems on Windows 7 (Vista?) and up - that they need to be digitally signed. (And signed by someone that Microsoft trust :sigh: )

HC-12Driver.jpg
 

techElder

was Texasclodhopper
#16
Success! I had to do some Chinese translation (and add some hope!)

I did get the correct driver with an installation program for Windows 7. Couldn't believe it.

However, I'm now part of an international syndicate that sells counterfeit rubber balls to the tennis sports industry. At least my computer is .... :D :D :D
 
Top