I have reinstaled all original files for arduport and started debuging… Again.:smiling_face_with_open_mouth_cold_sweat:
I didn’t mention it before, but I’m running MM on Raspbian lite.
I’ve found I had problems with python. Force reinstalling modules solved it.
I have allso found some errors in arduino.py,
Had to change:
rgxData = re.compile("[\[][a-zA-Z0-9-].*[\:][a-zA-Z0-9-].*[\:][a-zA-Z0-9-.].*[\]]")
to
rgxData = re.compile("[\[][a-zA-Z0-9\-].*[\:][a-zA-Z0-9\-].*[\:][a-zA-Z0-9\-\.].*[\]]")
and
incoming = self.arduino.readline(self.arduino.in_waiting).decode('ascii').replace('\r', '').replace('\n', '')
to
incoming = self.arduino.readline(self.arduino.in_waiting).decode('ascii', errors="ignore").replace('\r', '').replace('\n', '')
Now, when running
python arduport.py
I get this:
{"debug": "SerialPort shell started..."}
{"debug": "Waiting Ardunio to connect on port..."}
{"status": {"data": "connected", "name": "connect"}}
{"status": {"data": "starting", "name": "setup"}}
{"status": {"data": "started", "name": "setup"}}
{"sensor": {"data": "0.02", "name": "Baterija"}}
{"sensor": {"data": "-0.00", "name": "Struja"}}
{"sensor": {"data": "0.00", "name": "Solarno"}}
{"sensor": {"data": "-0.12", "name": "Panel"}}
{"sensor": {"data": "-0.00", "name": "Inverter"}}
{"sensor": {"data": "0.04", "name": "Baterija"}}
{"sensor": {"data": "-0.00", "name": "Struja"}}
{"sensor": {"data": "0.00", "name": "Solarno"}}
I’m guesing, this should be working now. But ArduPort is still stuck at “Waiting for connection…”
Here is C/P from my config.js
{
module: "MMM-ArduPort",
position: "top_right",
header: "Solarni sustav",
config:{
portname: "/dev/ttyUSB0",
updateInterval: 1,
animationSpeed: 1000,
displayIcons: false,
showDescriptopn: true,
hideLoading: false,
hideWaiting: false,
useColors: false,
sensors: [
{
name: "Solarno",
description: "Solarni sustav",
maxValue: 5,
maxFormat: "({0}) ",
highestValue: 4,
highestFormat: "({0}) Greska - pregrijavanje",
highValue: 3,
highFormat: "({0}) Greska - preopterecenje",
lowValue: 2,
lowFormat: "({0}) Backup mod",
lowestValue: 1,
lowestFormat: "({0}) Ukljuceno",
minValue: 0,
minFormat: "({0}) Iskljuceno"
},
{
name: "Baterija",
description: "Stanje baterije",
maxValue: 26,
maxFormat: "({0} V) Balansiranje",
highestValue: 25.5,
highestFormat: "({0} V) 100%",
highValue: 24.87,
highFormat: "({0} V) 75%",
lowValue: 24.2,
lowFormat: "({0} V) 50%",
lowestValue: 11.74,
lowestFormat: "({0} V) 25%",
minValue: 23.2,
minFormat: "({0} V) 0%"
},
{
name: "Struja",
description: "Punjenje ili praznjenje",
maxValue: 20,
maxFormat: "({0} A) Punjenje",
highestValue: 10,
highestFormat: "({0} A) Punjenje",
highValue: 0,
highFormat: "({0} A) ",
lowValue: -20,
lowFormat: "({0} A) Praznjenje",
lowestValue: -40,
lowestFormat: "({0} A) Brzo preznjenje",
minValue: -60,
minFormat: "({0} A) PREOPTERECENJE"
},
{
name: "Panel",
description: "Snaga solarnih panela",
maxValue: 500,
maxFormat: "({0} W)",
highestValue: 400,
highestFormat: "({0} W)",
highValue: 300,
highFormat: "({0} W)",
lowValue: 200,
lowFormat: "({0} W)",
lowestValue: 100,
lowestFormat: "({0} W)",
minValue: 0,
minFormat: "({0} W)"
},
{
name: "Inverter",
description: "Potrosnja invertera",
maxValue: 1000,
maxFormat: "({0} W)",
highestValue: 800,
highestFormat: "({0} W)",
highValue: 600,
highFormat: "({0} W)",
lowValue: 400,
lowFormat: "({0} W)",
lowestValue: 200,
lowestFormat: "({0} W)",
minValue: 0,
minFormat: "({0} W)"
}
]
}
},
EDIT:
Here is C/P from chrome console:
Starting module: MMM-ArduPort
MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: status
MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: {
"action": "status",
"name": "initialized"
}
MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: error
MMM-ArduPort.js:286 [MMM-ArduPort]:: MMM-ArduPort: "pyshell-throw"
MMM-ArduPort.js:123 [socketNotificationReceived::error]: