A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => Raspberry PI => Topic started by: AxelSariel on August 12, 2021, 09:51:40 PM

Title: Raspberry Pi & Classic 150-SL
Post by: AxelSariel on August 12, 2021, 09:51:40 PM
Hi! I'm new to the forum. We have two Classic 150-SL CC, and a Whizbang JR in our system. I want to access the Charge Controller's data with a Raspberry Pi for further processing. As far as I understand, SLs don't have Ethernet ports. How can I access the data in this case? I have seen other old posts talking about different methods such as Modbus but just wanted to ask in case there's any more reasonable solution at this time.

In case Modbus is the option, is there a trustable library or guide on using it? Have seen some old ones but again just in case there's any newer solutions.

Thanks!
Title: Re: Raspberry Pi & Classic 150-SL
Post by: schroew on August 12, 2021, 10:49:13 PM
I use the Modbus to MQTT. Mosquito pulls that data down to a file for each controller and then I have logstash, elastic, Kibana. I can share configs but dashboards and stuff that I wrote won't work for you. You can certainly use the logstash config though. I haven't packaged anything but I can VPN in and SCP all the files for you.
There are a few developer people around the forum here working on this exact topic.


https://github.com/ClassicDIY/ClassicMQTT
Title: Re: Raspberry Pi & Classic 150-SL
Post by: ClassicCrazy on August 13, 2021, 01:11:45 PM
Quote from: AxelSariel on August 12, 2021, 09:51:40 PM
Hi! I'm new to the forum. We have two Classic 150-SL CC, and a Whizbang JR in our system. I want to access the Charge Controller's data with a Raspberry Pi for further processing. As far as I understand, SLs don't have Ethernet ports. How can I access the data in this case? I have seen other old posts talking about different methods such as Modbus but just wanted to ask in case there's any more reasonable solution at this time.

In case Modbus is the option, is there a trustable library or guide on using it? Have seen some old ones but again just in case there's any newer solutions.

Thanks!

You need the option on the Classic DIY  link above that uses the ESP32 to connect to Classic SL serial port and  makes it into a wireless modbus port.
https://github.com/ClassicDIY/ModbusAdapter
Then you can use any software that uses modbus over IP like the Classic Monitoring App for android on above link, or the Midnite Local status app, or some of the others being developed in the forums here.
Here is the forum topic that talked about hooking up to Classic SL
http://midniteftp.com/forum/index.php?topic=4880.15

Larry
Title: Re: Raspberry Pi & Classic 150-SL
Post by: AxelSariel on August 14, 2021, 10:27:56 PM
Thanks so much to both! I'll check the code out and report back any progress!
Title: Re: Raspberry Pi & Classic 150-SL
Post by: ClassicCrazy on August 14, 2021, 10:38:18 PM
Quote from: AxelSariel on August 14, 2021, 10:27:56 PM
Thanks so much to both! I'll check the code out and report back any progress!

You will need to get an Esp32 and connect it to serial of your Classic SL - it is all documented on the classic diy page and in the post.

Larry
Title: Re: Raspberry Pi & Classic 150-SL
Post by: AxelSariel on August 16, 2021, 05:45:39 PM
Thanks! I ordered all the components so hopefully next week I get it up and running.
Title: Re: Raspberry Pi & Classic 150-SL
Post by: ClassicCrazy on August 16, 2021, 08:49:24 PM
Let us know how it goes.

Larry
Title: Re: Raspberry Pi & Classic 150-SL
Post by: AxelSariel on August 25, 2021, 09:53:08 PM
Reporting back progress; I got everything wired up with the rs232 ports on the controllers. I managed to flash the firmware onto the esp32 and the Midnite app connects to it. However, I’m not getting any data displayed. I get all the dials on zero, and empty settings.

Changed the Midnite USB Mode but nothing.

I checked all the wiring and it seems correct, what could it be? I tried loading the code with platformIO to debug the issue but didn’t succeed, some problem with the library linking in VS Code.

Thanks!
Title: Re: Raspberry Pi & Classic 150-SL
Post by: ClassicCrazy on August 25, 2021, 10:17:08 PM
I was having some of same issues - if you go back to one of those links above -  Graham had me try all kinds of things using different methods and some other softwares to debug it.
I never got mine going but the other guy who asked the question and Graham it has worked for.  Since I was trying it out on a 20 or 30 foot piece of cat5 cable to the classic I thought maybe that might have been my problem . I don't have a Classic SL so didn't really need it anyway and it was winter and cold in my shed where the Classic was so I never got back to it . I also had my Classics in Follow Me and wasn't sure if that messed with it.
What kind of rs232 to ttl converter are you using ?
You could also try hooking it up to a different jack in the Classic - oh not sure how many jacks you have on Classic SL - my regular Classic has three jacks and I think one is wired a bit different than the others.
Yeah you don't want to use the usb mode.
Look in the other post - there is are some debugging tools Graham talked about . http://midniteftp.com/forum/index.php?topic=4880.0
Larry
Title: Re: Raspberry Pi & Classic 150-SL
Post by: Graham on August 29, 2021, 10:50:29 AM
Quote from: AxelSariel on August 25, 2021, 09:53:08 PM

I checked all the wiring and it seems correct, what could it be? I tried loading the code with platformIO to debug the issue but didn’t succeed, some problem with the library linking in VS Code.

Thanks!

I noticed that one of the dependent libraries has been upgraded with breaking changes (IOTWebConf), I push an update to Platformio.ini to force it to use the original 2.3.1 version.

During my development of the adapter, I used an FTDI USB to TTL Serial Adapter  https://www.ebay.ca/itm/171907548227?hash=item28067d0443:g:puUAAOSwNSxVMjUU (https://www.ebay.ca/itm/171907548227?hash=item28067d0443:g:puUAAOSwNSxVMjUU) along with the coolterm serial port terminal https://coolterm.en.lo4d.com/windows (https://coolterm.en.lo4d.com/windows) to probe the serial data from/to the RS232 Interface Module.
I found some of the cheap RS232 Interface Modules from ebay did not work reliably, the esp would send a request but the classic would not reply...

hope this helps

Graham