Can you use 2 HC-12 modules to communicate without a microcontroller?

Discussion in 'Embedded Systems and Microcontrollers' started by hughbertx, May 16, 2019.

  1. hughbertx

    Thread Starter New Member

    May 13, 2019
    6
    0
    Hello members,

    I have an Aurora Power-One 5kW solar inverter. The inverter has an RS485 interface I have used to hard wire a cable to my PC. On the PC I have old software (Aurora Communicator v2.9.21) which communicates with the inverter using 19200 baud 8N1 via a virtual COM port. The cable is connected to my PC using an RS485 to USB module and everything works nicely. The problem is the cable, I want to replace the cable using HC-12 modules (hopefully).
    A couple of weeks ago I purchased two HC-12 modules from ebay. I have tested these modules and they communicate successfully between a RPi3B and an Arduino UNO. I have changed the settings on the modules to use 19200 8N1 and attempted to connect them to either end of my existing setup. One connected to the RS485-USB module, and one to the inverter side of the cable. I have tried all wiring combinations of RX/TX on both HC-12s, but I cannot get the software to communicate with the inverter using these modules.
    Am I naive (ignorant/stupid)? Can these modules work independently from a microcontroller?

    Thanks for any advice.

    hughbertx
     
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    4,625
    732
    Are they digital?
     
  3. hughbertx

    Thread Starter New Member

    May 13, 2019
    6
    0
    Yes, they just wireless serial communication transceivers. I was hoping it would be plug and play after changing the baud rates of the modules to match the existing settings the communication software uses, but something is obviously wrong. It was pretty simple getting them to communicate between the RPi and Arduino.
     
  4. shteii01

    AAC Fanatic!

    Feb 19, 2010
    4,625
    732
    You need a micro.
     
  5. hughbertx

    Thread Starter New Member

    May 13, 2019
    6
    0
    Ok, thanks. I was hoping they'd just pass on what they received autonomously, but it seems my little experiment just got a little more complicated.
    Thanks again.
     
  6. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    7,644
    1,864
    Given the right conditions this arrangement, with no MCU, should work OK.
    Are you using FU3?
    Is the SET pin held high?
    Is the data being sent continuously, or in packets?
    Will the application object to the time delay between transmit and receive?
    Are the aerials at least 2 metres apart?
     
  7. hughbertx

    Thread Starter New Member

    May 13, 2019
    6
    0
    Hi AlbertHall,
    Yes, it's still using the default FU3 setting.
    Yes, the SET pin is set high... I have it connected to the positive of my power supply. I hope that's not stupid.
    I don't know if the data is being sent continuously or in packets. I don't have any equipment to check, and I couldn't find anything in the limited documentation I have.
    Again, I don't know if the application will object to a time delay between transmit and receive.
    I have the aerials about 4 metres apart, in the same positions they were when successfully communicating between my RPi and Arduino.
    I have it connected up at the moment, and the TX LED on the RS485 to USB module is flashing continuously for 8 seconds, while the RX LED blinks about every second. Then there's a delay and the cycle repeats.... Does that cycle mean anything to you?
    When I have it hard wired and working correctly, the TX/RX LEDs blink off and on in no specific pattern.
     
  8. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    7,644
    1,864
    OK.
    RS485 is differential - two wires per signal - whereas the HC-12 (and RS232) have just one wire per signal.
    How have you connected the two RS485 inputs to the HC-12 output?

    Also the signal voltages on RS485 are not (necessarily) the 0V to 5V signals that the HC-12 uses. Do you have any level conversion?
     
  9. hughbertx

    Thread Starter New Member

    May 13, 2019
    6
    0
    Hmmm, you might have just highlighted a fundamental problem with what I'm attempting to do.
    I just checked the voltage on the TX/RX lines while hard wired to the inverter using the RS485-USB module and the voltage doesn't get above 250mV. There are 3 wires out of the inverter, TX, RX and RTN. That voltage check was the TX/RX wires using RTN as ground.
    I guess the HC-12 modules don't even recognise there's a signal at that voltage.
    The RS485 module has 3 inputs/outputs (A, B and -). I've connected the TX/RX/RTN to those. When connected to the HC-12, the A, B and - go to TX, RX and ground of the HC-12.
    Do you have any ideas on boosting the signal, or is using the HC-12 for this becoming a pipe dream?
     
  10. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    7,644
    1,864
    Do you have (access to) an oscilloscope?
    If so look at the RS485 signals when connected as intended.
    Whatever you are going to use you are going to have to make sure that all the signal inputs and outputs have matched levels.
     
  11. hughbertx

    Thread Starter New Member

    May 13, 2019
    6
    0
    Hi AlbertHall,
    No, I don't have access to an oscilloscope. I've just ordered one so I can investigate issues in the future.
    Thanks for trying to help with this issue, but I've decided to take a different route. This is getting beyond the scope of this module (me).
    I ordered some ESP8266's a while back, and they arrived on Friday. I've just discovered that I SHOULD be able to
    connect to my inverter using one of these..
    Fingers crossed!! :-S
     
  12. KeepItSimpleStupid

    AAC Fanatic!

    Mar 4, 2014
    3,281
    586
    OK, a couple of things. RS485 isn;t RS232. It's much worse to get communication.

    RS485 requires terminators and it requires a device number, so the device knows to respond. It's MASTER/SLAVE too. the MASTER talkes to everyone, but only the addressed slave responds. RS485 requires termination resistors at both ends of the bus.

    It's also differential signalling,

    I'd almost suggest going virtual comport to Ethernet to RS485. Get an adapter that will go to RS485 va a virtual com port connected to Ethernet.

    If the protocol is MODBUS, that protocal can be put over Ethernet.

    I set-up exactly one system (multiple slaves) using RS485 and it was a bear.
    In another case a Macintosh computer with RS422 would not communicate to an RS232 box with the standard tricks (An RS232 modem) cable.)
    The levels were not high enough and I needed a real converter.

    Here https://www.gridconnect.com/products/atc-108n-industrial-isolated-232-to-485-adapter is a converter. When selecting, you need to be careful if cost is your objective.
     
Loading...