A Forum run by Enthusiasts of MidNite Solar

Charge Controllers and Clippers => The "Classic" charge controller => Topic started by: lilcheez on December 03, 2021, 03:08:30 PM

Title: Using a microcontroller to read data from the Classic USB port
Post by: lilcheez on December 03, 2021, 03:08:30 PM
I would like to connect a microcontroller to the Classic's USB port in order to collect the data being printed out.

When I connect the Classic's USB port to my PC and open a serial terminal (e.g. PuTTY), I get a stream of data printing out. But when I connect the Classic's USB port to my Arduino Due USB port, I get nothing. I know the Arduino Due is capable of acting as a USB host, but I don't know what sort of handshake is necessary to get the data to start streaming. How can get the data to start so that I can capture it?
Title: Re: Using a microcontroller to read data from the Classic USB port
Post by: ClassicCrazy on December 03, 2021, 06:10:50 PM
I don't know the answer to your question.
I think there are different settings for usb port that are configured in Comms menu. Details available somewhere but I don't know them.
There are also other ways to get data from the Classic via modbus.  Those methods are documented in the opensource software sections of the forums here.
You can  use a raspberry pi or Esp32 to get the data via modbus and convert it to mqtt form. 
Some of that depends on which model Classic you have.

Larry
Title: Re: Using a microcontroller to read data from the Classic USB port
Post by: boB on December 03, 2021, 11:50:27 PM
Hey lilcheez....

The CDC serial port emulation is what you want I think.  At least that is what is used on the PC.

I found this using Google which may help.

The key words are CDC serial port emulation.

https://forum.arduino.cc/t/using-serial-monitor-with-native-port/318753/7

You probably already know about the USB mode that is selectable in the MNGP under MISC, COMM ?

The default spits out some basic voltages and current as I remember at a rate of a few times per second.

The baud rate may be 19.200 K but using USB I do not think it matters much what you set it for.  I cannot remember much about that and don't know anything about  Arduino usage.

Let us know how it goes if you think of it.

boB