• C
    Cyberdog

    A little gem that I thought someone may find useful.

    Hardware:
    Raspberry PI 256MB Rev 2 (Overclocking to "dynamic turbo", and re-allocating the gpu memory helps speed up java a bit.)
    Digital to Serial converter 3.3 / 5V to RS232 (from ebay [http://goo.gl/sjdzN])
    Ablerex 60Amp MPPT Charge controller
    Custom made Serial Cable( 1<->4, 2<->3, 3<->2, 4<->1&6, 5<->5, 6<->4, 7<->8, 8<->7, 9<->9)

    The Installation packages used:
    ma-full-core-2.0.3
    m2m2-modbus-1.4.1
    m2m2-scripting-1.0.0
    jdk-8-ea-b36e-linux-arm-hflt-29_nov_2012
    librxtxSerial-2.2pre1

    After doing the installation and getting everything working, the serial port drop down list in Mango remains empty.

    After trying all sorts of tricks, the only one that managed to get the problem resolved is creating a symbolic link to the serial port. (Clearly, the rxtx library is expecting a certain naming for the serial ports)

    sudo ln -s /dev/ttyAMA0 /dev/ttyS0
    chown root:dialout /dev/ttyS0

    posted in Mango Automation Installation read more
  • C
    Cyberdog

    @Joel,

    Awesome, thank you. I Have downloaded that, and I will test this out during this week, as time permits.

    Just another point that I forgot, which just showed up on this download. I had to edit the ma-start.sh file to remove the -server option from the java startup (Line 45). When that option is included, the startup script fails with:

    Error occurred during initialization of VM
    Server VM is only supported on ARMv7+ VFP

    When that option is removed it runs on the Pi. That probably also has an impact on the performance.

    This Beta version has so far started up with no problems. (After removing the -server option)

    posted in Mango Automation Installation read more
  • C
    Cyberdog

    The Performance of mango on the PI is slow. Each page accessed from the Pi takes a while to render (6 seconds to show page, and another 9 seconds to render the graph, when clicking on a data point). I am sure that the 512Mb Pi should be more responsive.

    The Linux performance:
    up 7 days, 5:40, 1 user, load average: 0.26, 0.25, 0.21

    The Mango java process:
    VIRT RES SHR %CPU %MEM TIME+ COMMAND
    226m 144m 3524 11.5 78.1 228:50.24 java

    My goal was data acquisition, and reporting. To access the data once a day, and to receive an email report daily works perfectly. So the tardy access is acceptable for me. The data gets retrieved every 5 seconds, which is more than enough data for me. I get emailed with the day's power, and I can log in and view detailed information for the day, albeit slowly. It has run continuously for the last week with absolutely no issues so far. I have only had to restart mango after accessing it from to many IP addresses (Using no-ip.com and port forwarding to access this from outside, I have been showing it off to everyone!) Costs versus functionality, It is incredibly awesome! With a relatively simple setup, I have a lot of information available. Though I am still trying to figure out how to get the AH and work out the currently available power, though this will only be possible if the outgoing current is also being monitored (I am still working on this)

    The pi mainboard is standard. The Power is taken directly from the main batteries with an adjustable 1.5 to 30V 3A Converter / LED Driver Charger circuit purchased from ebay. (http://goo.gl/Xzhlm) This I had adjusted to exactly 5.0 Volts out, then cut one of the micro usb cables (cut off the big square USB plug) and soldered it onto that board to connect it to the pi. The other side of the power board I soldered cables to eyelets, and connected it directly to the main battery terminals. Very efficient, regulated 3A power for the Pi. And still runs even if the mains inverter is off. The SD card, also from ebay, was the cheapest class 10 card I could find. The Raspberry image was the stock standard one from the Pi Site. The Casing for the Pi is the one from Farnell (The only gripe with this is that it has no slot to access the GPIO) I used a hacksaw to cut a square out on the one side of the Pi casing to plug in the serial cable to the serial port mounted inside the casing, which is kept in place with double sided tape (Though, its not necessary as the serial port rests snugly against the S2 connecter on the main board when the casing is closed and cannot move). I am still trying to source an affordable Pi case with a serial port opening. I am not happy with the current horrible hack even though it is not immediately apparent. The Pi connects to my home network via wireless (Cheapest usb wireless N card I could find on ebay) I have left the unit headless (No screen or keyboard) and modified the (/etc/wpa_supplicant/wpa_supplicant.conf) to always give a fixed ip address.

    -----------------------------------------------------------

    edit: /etc/wpa_supplicant/wpa_supplicant.conf

    -----------------------------------------------------------

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1

    network={
    ssid="CYBERHOME"
    psk="myveryunsecurepassword"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=TKIP
    auth_alg=OPEN
    }

    -----------------------------------------------------------

    edit: /etc/network/interfaces

    -----------------------------------------------------------

    auto lo
    iface lo inet loopback
    iface eth0 inet dhcp
    allow-hotplug wlan0
    iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

    iface default inet static
    address 192.168.1.100
    netmask 255.255.255.0
    network 192.168.1.0
    gateway 192.168.1.1

    The Charge controller I am using is the 40A, 60A (12/24/36/48V) from mppsolar (http://goo.gl/TQZkF) The other ones even though they have awesome futures do not have the communication interfaces.

    The Inverter I am using is an off grid 3KW / 6KW from the same company. Solar panels are 2 x 240 Watts Sharp Panels. (I live in an apartment, and I am still trying to figure a way to put up another two panels without going over the small allocated space on the cluttered roof, and still get sun)
    4 x 80Ah (Sunlight SP12-80 AGM) 5 x 26Ah (Sunlight SP12-26)

    • The final goal is to have 10 x Sp12-80's only. (I am in the process of building a square steel tubing rack for this, I helped a friend make a pilot one this weekend and it works great) The Royals, and other non sealed lead acid batteries are not usable inside an apartment. Gassing and acid is a really big issue.

    My next step is to control the mains relay isolators on / off depending on the available and incoming power, and to finally switch the inverter on / off if needed (it has a remote switch). I am hoping to do thus all through Mango. I know that Mango can do it, I still just have to figure out how.

    To a get a better performing machine, which is my next project, once I get this system working the way I want it to, is the use ODROID devices. (http://goo.gl/SWO8C), (http://goo.gl/6cShf), (the second one includes GIO controls as well). They have quad core processors and similar, but much better specs than the pi, though the one with GPIO is about 130$ which is a lot more than the Pi, but a lot less than a laptop or PC, and it has some very decent specs. The smaller one is about 89$ with some very good hardware.

    I think an alternative is to use mango on the Pi simply as a data logger, and run mango on a normal machine to process the data once a week. Best of both worlds. Guys at infiniteautomation, is this doable? Either way, Mango makes data collection very simple, and works very well.

    Pi Hardware summary:
    1 x Raspberry Pi 35$ (40 Euro from local Farnell)
    1 x Pi Casing 15$ (Also Farnell)
    1 x Serial Port 3$ (ebay)
    1 x DC Converter 3$ (ebay)
    1 x USB Serial cable 1$ (ebay)
    1 x 16GB Class 10 SD 11$ (ebay)
    1 x Wireless N Wifi USB 4$ (ebay)
    2 x RS232 Serial plugs 6$ (Farnell)
    Total 78$

    Sorry about the long winded answer... I hope I have covered everything. If there is any more information needed, please give me specifics, and I will answer what I can. I am also open to any suggestions and advice.

    posted in Mango Automation Installation read more
  • C
    Cyberdog

    A little gem that I thought someone may find useful.

    Hardware:
    Raspberry PI 256MB Rev 2 (Overclocking to "dynamic turbo", and re-allocating the gpu memory helps speed up java a bit.)
    Digital to Serial converter 3.3 / 5V to RS232 (from ebay [http://goo.gl/sjdzN])
    Ablerex 60Amp MPPT Charge controller
    Custom made Serial Cable( 1<->4, 2<->3, 3<->2, 4<->1&6, 5<->5, 6<->4, 7<->8, 8<->7, 9<->9)

    The Installation packages used:
    ma-full-core-2.0.3
    m2m2-modbus-1.4.1
    m2m2-scripting-1.0.0
    jdk-8-ea-b36e-linux-arm-hflt-29_nov_2012
    librxtxSerial-2.2pre1

    After doing the installation and getting everything working, the serial port drop down list in Mango remains empty.

    After trying all sorts of tricks, the only one that managed to get the problem resolved is creating a symbolic link to the serial port. (Clearly, the rxtx library is expecting a certain naming for the serial ports)

    sudo ln -s /dev/ttyAMA0 /dev/ttyS0
    chown root:dialout /dev/ttyS0

    posted in Mango Automation Installation read more