To visit MidNite Solar click this link

Main Menu

BBB Classic monitor

Started by dgd, May 15, 2016, 05:37:03 PM

Previous topic - Next topic


Just took delivery of new Element14 BBB revC and  the IDE (bone) for this has to one of the best I have used for C++ code development.
First task was to get the IC2 bus, ie the one available, of 3, on I2C2 talking. No issues as plenty of examples on its use and several very informative libs too.
Wired it to an Arduino Nano that just has a serial port to Classic running Modbus Master code extracting about 50 register values. Then wire library move these to the BBB
Seems to run fast and clean, the BBB people say about 100kb/sec.
Now getting the code together for making XML/Json data files to AJAX to web pages served from BBB using Apache.
I want to eventually get multiple Classics and maybe Kids connected to the BBB server. Using a small Nano on each Classic just feels right.
One of my greatest joys here is that I get back to using an old friend, the Unix VI editor, this means I can leave all the Notepad and associated crap Windows junk
Anyone else doing anything Classic interesting with the BBB?   :)

Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

paul alting

Hi David,

That is interesting news.
I've been out of the loop for the past few months with a busy automation PLC /SCADA job, and am happy to be slowly getting back to where I was.

I have been looking at the situation of small Linux SBC's lately and and trying to make a decision of what to use if I move away from the Cubieboard.
I have not used a beagle board, though I have read about the BBB revC and from Element14.

I just don't seem to be able to move downward toward the Pi family, although some of the other Pi could be tasty :)
Then I looked at ORDOID, and after lots of other looking I get overwhelmed by choices.

Anyhow I have rejuvenated my Cubieboard II with what appears to be a well supported Linux/GNU distribution, Armbian, which was a total breeze to install and has the Cubie working with mainline kernel.

So, you have an Arduino Nano talking to the Classic and then passing that data via I2C back to the BBB, sounds good.
Is there any reason not to just use the BBB to talk directly to the Classic ?

Windows, don't talk to me about Windows, man, I'm playing around with digital radio DRM with a cheap Chinese Handie-Talkie and feel so discouraged by a wasted day.
Our local amateur radio club has a Classic install at the top of the mountain I'm on as part of our multiple repeater installation and I'm sort of getting ideas of wanting to be able to connect into it to get and log data, other than via the local app.
I had thoughts of your nice implementation using a DUE.

I'm interested in your ideas for the XML/JSON and AJAX part of it too, as I am just this week getting my head back into my Modbus SCADA system, Quadlog.
I'm seeing code in their that I just don't remember doing, like using the jansson library for HTTP. Surely I should remember what I code I wrote, it is even commented by me, gosh, is this a sign.

Anyhow David, keep up the work and keep posting, I find it very interesting what you are doing.
Paul - VK7KPA
6 x 200W PV into home-brew 6 stage MOSFET charge controller : Microhydro 220Vac 3 phase IMAG
8 x 400Ah LiFeYPO4 Winston : Latronics LS2412 inverter
QuadlogSCADA control and monitoring system : Tasmania, Australia :


Hi Paul,

Good to hear from you again.  :)
I spent some time playing with the Cubie2 but one day when web serving multi-Classic web page it just stopped and was completely dead. The A20 cpu just decided its time was up.
So I bought a BBB and an rPi3+, the militarised version of the BBB then had to provide much detail about my plans for it to satisfy some export regulations, I assume to ensure it wasn't for a military application  ???

I now wish I had bought the BBB earlier as its IDE and vast support base makes it a pleasure to use with the bonus of a proper C++ compiler, Vi editor and  nice unix preloaded.

The reason for i2c bus use to individual Nanos in each Classic is because its a major headache getting decent Modbus support that can deal with multiple Classics. I nearly had it reliable for 4 Classics with rs232 ports daisy chained and device addresses 10 thru 13 as described in the MNISCOMM device docs but after a while it goes to snafu mode mostly because some unknown event causes one or more Classics to reset to default address 10 or some other value, 3 seems a common occurance .
This screws to daisy chain and messes to web reporting.
I even went to rs485 bus converters on each Classic, way too slow and again device addressing was an issue.
In my DUE server code I used a time switching method using millis to simply move between rs232 ports on the DUE with a Classic to each serial port.  Worked great if 5 second gauge updates was ok, which of course it wasn't but sort of looked ok with just largish text digits.
So then gave each Classic its own Mega and had Cubie server ethernet connect to each mega and combine date for web display. Worked but was ugly, boards wires and power supplies everywhere probably consuming 40 to 50 watts

So next incarnation was Arduino Nano running Modbus rtu with teensy max232 card to rs232 to Classic then ic2 slave connection to Cubie (now BBB). Can get the nano inside the wiring bay with just serial wire to rj11 socket and twisted pair to 0v and 5v pads on Classic pcb and then to outside a metre or so of ethernet cable as i2c bus connection to BBB. The nano and max232 card fit inside a couple of inches of 80mm shrink wrap, unshrunk of course  :P all tucked neatly on side of wiring bay. I just used a tiny glob of silicone to hold the shrink wrap to inside wall of Classic (photo soon)


Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand


This is not really about BBB as I have no experience with them but it is about the topic of communicating with more than one Classic. I've been thinking about the best way to communicate with my two Classics and also Larry's project is about communicating with the Elite CPU and a Classic. I have not had much time to look at it but the Propellor board is an 8 core board that can be programmed in C or Spin. I need to look at the board more but I am thinking if each "cog" communicated with it's own Classic and added the data to the common memory in the "hub" it would be a nice system. Could be there is not enough memory to make it work. I think this will be a winter project for me to look at.

(1)24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 4x Magnum 4448, homecooked diversion system;(2)15 Heliene 330 mono,Classic 150;(3)2X6 Hansol345mono, 2 stand alone Hotspot ACDC12C Minisplit heat pumps.(4)15 Hanwha Q cell 400 1/2 cell, Classic 200: (5)1X6 HanwhaQcell 400 1 Hotspot minisplit ACDC18C