RE proof of concept: need some help

Started by Barry Fields, January 23, 2025, 03:04:51 PM

Previous topic - Next topic

Barry Fields

I have attached below what I wish to do.

Which Raspberry model would be most appropriate?
Do I need additional hardware between my PC and the Raspberry?
What software would I need on the PC to communicate/program the Raspberry?
Will this configuration allow me to access the Charge controller indirectly?
Is there a preference for TTL shields?

Any and all suggestions would be appreciated.
Thanks Barry
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

ClassicCrazy

#1
You have an Arduino on your picture - is that where you are thinking of putting a raspberry pi?  You might be better off using an ESP32 to communicate rs485 to  your controllers ? That has built in wifi.
You could have the ESP32 send out the data it gets  as mqtt . Then you could use a raspberry pi to collect that mqtt and do whatever.
You can get a raspberry pi zero 2 W for $15 and see if it does what you want it to do. You set it up to work headless meaning that you would get into it via ssh from a terminal on your windows computer if that is what you use. Or if you want to get into it via full web interface you would set it up for VNC Viewer from your windows computer . So you don't need any screen or keyboard on your raspberry pi - just have to set it initially to connect to your router. The Pi Imager will let you set it up with your wifi before you even boot it - that is a nice feature that saves steps on how you used to have to do it .
Look on Adafruit for the Pi Zero 2 W. Of course you will also need an SD card and nice to have a case that will heat sink it. You can get a heatsink case on aliexpress for $3 . Or look on Amazon for on Vilros or Canakit I think they sell starter kits.
I want to clarify that if you look at these don't confuse the older pi zero w with the newer and better pi zero 2 w .
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

Barry Fields

You have an Arduino on your picture - is that where you are thinking of putting a raspberry pi?  YES

You might be better off using an ESP32 to communicate rs485 to  your controllers ? That has built in wifi. I would prefer not to use wifi for that connection. For hardwire, are the two boards shown appropriate? I am not sure which is more appropriate.

You could have the ESP32 send out the data it gets  as mqtt . Then you could use a raspberry pi to collect that mqtt and do whatever. The data reads and writes to/from the Charge controller would be in the order of once a second or two for a few bytes of data/commands.

You can get a raspberry pi zero 2 W for $15 and see if it does what you want it to do. Looks good.
 You set it up to work headless meaning that you would get into it via ssh from a terminal on your windows computer if that is what you use. I intend to connect the Raspberry to my PC via an open port on my router. Does that mean SSH?

 Or if you want to get into it via full web interface you would set it up for VNC Viewer from your windows computer . Only need local access.

 So you don't need any screen or keyboard on your raspberry pi - just have to set it initially to connect to your router. I think by pre-programming an SDcard?

The Pi Imager will let you set it up with your wifi before you even boot it - that is a nice feature that saves steps on how you used to have to do it . Is Pi Imager the only software necessary to both start and program the Pi Zero 2 W ?
 
Look on Adafruit for the Pi Zero 2 W. Of course you will also need an SD card and nice to have a case that will heat sink it. You can get a heatsink case on aliexpress for $3 .Or look on Amazon for on Vilros or Canakit I think they sell starter kits.I want to clarify that if you look at these don't confuse the older pi zero w with the newer and better pi zero 2 w . Understood.

Just found out that my nephew is donating a raspberry pi 3. I will investigate specific model when it arrives.

Thanks again for your comments. very helpful.
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

ClassicCrazy

get the pi imager  from pi website.
The  pi imager will download the right pi os   for your pi .
Yes it will all work on your local network . You just go to the ip assigned to it     by your router.
ssh is a secure command line that you use a terminal program to get into .
VNC gets you into the full web screen of the pi .
Look on adafruit - they have good tutorials . Or  Explaining Computers on youtube -  he makes very good beginners videos with all the steps you need to know.
larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

qcda1

There are different ways to get Classic data in a micro computer. The easiest for me is the Raspberry Pi with Ethernet link to the solar charge controllers and the use of Python. You can easily get data from the controller to the computer with pymodbus directly or use simplified modules catered for the Classics. Take a look at what I published yesterday on GitHub: https://github.com/qcda1/MidniteClassic

If you want MQTT interface, this will do: https://github.com/ClassicDIY/ClassicMQTT

Now for writing to the registers, I'm thinking of adding this to my module. You can still use pymodbus to write to the Classic's registers. :)

To display data to users, I believe a web interface is the most versatile for the complexity. Any browser will be able to view data and pretty much from any device. It allows to use a headless installation making more resources available for my programs vs an OS GUI. Use of VPN such as ZeroTier simply allow to view data from outside your home network.

Here's a sample of how I use my collected data:
1,2kW on tracker, 1,4kW fixed, 2xMidnite Classic150, Magnum MS4448PAE, 4xMapleLeaf 48VDC/100Ah LiFePO4 and Kohler 14RCA with homegrown monitoring/alerting system.

Barry Fields

I feel pretty confident in saying that I can run Modbus for 15ft on 4wire (use 4 of 6) RJ12 untwisted flat telephone cable. I seem to remember running 56k over phone lines. 56k is about 8000baud and MidNite does 9600 baud.
Am I right that it should not be an issue for 15ft?
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

ClassicCrazy

Quote from: Barry Fields on January 27, 2025, 10:35:42 PMI feel pretty confident in saying that I can run Modbus for 15ft on 4wire (use 4 of 6) RJ12 untwisted flat telephone cable. I seem to remember running 56k over phone lines. 56k is about 8000baud and MidNite does 9600 baud.
Am I right that it should not be an issue for 15ft?
I have run modbus on rs485 that far for a meter. Although I used a piece of cat 5 cable if that makes any difference .
larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

qcda1

Quote from: Barry Fields on January 27, 2025, 10:35:42 PMI feel pretty confident in saying that I can run Modbus for 15ft on 4wire (use 4 of 6) RJ12 untwisted flat telephone cable. I seem to remember running 56k over phone lines. 56k is about 8000baud and MidNite does 9600 baud.
Am I right that it should not be an issue for 15ft?

Do you mean running Ethernet over flat phone wire?
1,2kW on tracker, 1,4kW fixed, 2xMidnite Classic150, Magnum MS4448PAE, 4xMapleLeaf 48VDC/100Ah LiFePO4 and Kohler 14RCA with homegrown monitoring/alerting system.

ClassicCrazy

Quote from: qcda1 on January 29, 2025, 10:20:34 AM
Quote from: Barry Fields on January 27, 2025, 10:35:42 PMI feel pretty confident in saying that I can run Modbus for 15ft on 4wire (use 4 of 6) RJ12 untwisted flat telephone cable. I seem to remember running 56k over phone lines. 56k is about 8000baud and MidNite does 9600 baud.
Am I right that it should not be an issue for 15ft?

Do you mean running Ethernet over flat phone wire?
I think  he is talking about running RS485 modbus communications.
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

Barry Fields

I messaged Raspberry pi with this question:

I wish to use my Win10 64bit desktop to do all programing to download to my raspberry PI3 via my router (hard wire not wifi). I am unsure exactly which Raspberry PI Imager I should download.

They replied:

We are unable to offer individual support. Instead, posting to our discussion forum is the recommended option; many of the engineers who work at Raspberry Pi are very active in answering questions there, and there are thousands of Raspberry Pi experts who are waiting there to help beginners and advanced users alike.

It appears you guys are more helpful.
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

ClassicCrazy

Barry ,
what kind of programming are you talking about ?
A Raspberry Pi is just a linux computer.
You can get into it's desktop either by plugging it into a monitor . Or you can use your windows computer to get into the pi either by ssh via a terminal program, or to the pi's desktop via VNC which has to be set up on both the Windows computer and on the Raspberry Pi.
It isn't too complicated and there are plenty of youtube videos showing how to do that.
The Raspberry Pi imager is a Windows program used to flash the Raspberry Pi OS to an SD card which you then put in the Pi to make it work. The imager tool will ask which Raspberry Pi board you have and select the right OS image for it and then flash it to the SD card.
Once you get on the Raspberry Pi , I am not sure what kind of programming you are wanting to do ?  I am a bit of novice but you can write python code and run them. You can also use node red which may be a bit easier and more intuitive for what you want to do. Of course you can also run Node Red on your windows computer.
All this stuff of course has a learning curve if you never used it before.
The other options are to use an Arduino to control your stuff. The Arduino might be easier to start with since it has lots of in out pins of analog, digital , pwm , rx tx etc. The raspberry pi is more limited on those things . The other option is to use an Esp32 .
For both the Arduino and Esp32 you can use the Arduino IDE program which you can write the code and debug it a bit , and then download to the Arduino . it is easy to modify your code , and to get and install libraries for different things.
I am no expert on any of those things, but know how to get around and have dabbled. I also spent and still do spend lots of time trying to figure out errors . Some of them can be a rabbit hole of time spent finding a solution by reading documents, watching youtube videos , etc. The good part of Arduino is that there is a lot of support for it, and the libraries have  example code to run which you can then copy and paste to use in your project, or find someone else's project and copy the parts you need.
I think from the sounds of what you want to do you might be better off starting out with Arduino.
The Arduino IDE also works with Esp32 boards which can also do a lot of things.
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

ClassicCrazy

Barry ,
Take a look at this video and it will give you an idea of arduino coding , but more importantly how you can use AI tools to help you with the code.
https://youtu.be/Va2XHyBQLoM?si=sO-Ig8-HsKgg5T8r
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

ClassicCrazy

You may also want to look through this topic of a project where an Arduino was used to write values to a Classic via modbus to pwm some of the power. I may have described it wrong . It had something to do with charging a battery on a car but the discussion of the Arduino code should be of help to you .
https://midniteftp.com/forum/index.php?topic=2511.0
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

Barry Fields

Thank you Larry,

Right now I am in ABSORB mode. A lot to process.When I go to float I will make some sort of comment.  :)
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

Barry Fields

20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.