Skip to content

Commit

Permalink
release 0.3.14
Browse files Browse the repository at this point in the history
version 1.9.32
fixed the MAC address of the bluetooth module
fixed update scripts to handle added files better and to not overwrite configurations in /etc/
added current based peak and hold for the output module in firmware 1.3.2
  • Loading branch information
SpieringsAE committed Jan 26, 2023
1 parent 3ff6af6 commit 7445a5d
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 22 deletions.
6 changes: 5 additions & 1 deletion etc/controller_update/controller_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
files = backup.readlines()

for i, file in enumerate(files):
files[i] = file.split("\'")[-2][2:]+"\n"
path = file.split("\'")[-2]
if path[-1] =="~":
files[i] = path +"\n"
else:
files[i] = ""

with open("/etc/controller_update/backed-up-files.txt" , "w") as backup:
backup.writelines(files)
Expand Down
6 changes: 5 additions & 1 deletion etc/controller_update/controller_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ fi

cd /tmp/GOcontroll-*

cp -r -v --force --backup ./ / > "$FILE"
cp -r -v --force --backup ./etc/controller_update/ /etc/ > "$FILE"

rm -r ./etc/

cp -r -v --force --backup ./ / >> "$FILE"

echo 'files moved registering backup'

Expand Down
19 changes: 18 additions & 1 deletion etc/controller_update/current-release.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
0.3.13
0.3.14

0.3.14
repo ver V1.9.32
fixed faulty control of the IR module refueling LED control
fixed output module bugs in node-red, incorrect documentation and peak time bug for peak and hold.
fixed the bluetooth name generated in first-install
user feedback improvements for the simulink read/write nodes in node-red
updated uiojs from 1.0.4 to 1.0.5
fixed bugs in read-simulink-signal and write-simulink-parameter nodes, uiojs import check was broken and is now fixed.
improved detection of whether the simulink model is running.
fixed the parameter writing key.
small improvement to parse_a2l.py.
fixed the bluetooth startup for the GOcontroll display controller.
fixed the MAC address of the bluetooth module
fixed update scripts to handle added files better and to not overwrite configurations in /etc/
added current based peak and hold for the output module in firmware 1.3.2

0.3.13
repo ver V1.9.27
fixed upload server so it no longer hangs on unknown files being sent.
Added read simulink signal and write simulink parameter to the nodered nodes. These can be used to communicate with a running simulink model directly instead of through files.
Added go-parse-a2l command, this parses the a2l file in /usr/simulink/ so it can be used by the new nodered nodes, and future applications involving direct memory reading/writing.
Expand Down
5 changes: 5 additions & 0 deletions installer/gocontroll-first-install
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ case $hw in
*Screen*)
echo PRETTY_HOSTNAME="GOcontroll-Moduline Screen_$mod" > /etc/machine-info
esac


echo -e "${YELLOW}-Fixing the bluetooth mac address ${NORMAL}"

sed -i "s/macplaceholder/43:43:A1:12:1F:$(openssl rand -hex 1)/g" /usr/moduline/bash/go-bluetooth-start.sh

echo -e "${YELLOW}-Controller ready ${NORMAL}"
echo -e "${YELLOW}-A quick reboot is advised ${NORMAL}"
4 changes: 2 additions & 2 deletions usr/moduline/bash/go-bluetooth-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ if [[ $(tr -d '\0' < /sys/firmware/devicetree/base/hardware) == "Moduline Screen

echo -e "${YELLOW}-Setting up bluetooth for the Moduline screen ${NORMAL}"

hciattach /dev/ttymxc1 bcm43xx 921600 flow
hciattach /dev/ttymxc1 bcm43xx 921600 flow nosleep macplaceholder

else

echo -e "${YELLOW}-Setting up bluetooth for the Moduline controller ${NORMAL}"

hciattach /dev/ttymxc0 bcm43xx 921600 flow
hciattach /dev/ttymxc0 bcm43xx 921600 flow nosleep macplaceholder

fi

Expand Down
24 changes: 12 additions & 12 deletions usr/moduline/python/installModuleFirmware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import subprocess
from subprocess import run, PIPE
from multiprocessing import Pool
import glob
from glob import glob
from packaging import version

OKGREEN = '\033[92m'
Expand All @@ -12,19 +12,19 @@
def upload_firmware(args):
slot = args[0]
new_firmware = args[1]
stdout = subprocess.run(["node", "/usr/moduline/nodejs/upload-new-module-firmware.js", str(slot), new_firmware], stdout=subprocess.PIPE, text=True)
stdout = run(["node", "/usr/moduline/nodejs/upload-new-module-firmware.js", str(slot), new_firmware], stdout=PIPE, text=True)
return [str(slot), stdout.stdout]

#check if simulink or nodered is running and stop them.
simulink_status = subprocess.run(["systemctl", "is-active", "go-simulink"], stdout=subprocess.PIPE, text=True)
nodered_status = subprocess.run(["systemctl", "is-active", "nodered"], stdout=subprocess.PIPE, text=True)
simulink_status = run(["systemctl", "is-active", "go-simulink"], stdout=PIPE, text=True)
nodered_status = run(["systemctl", "is-active", "nodered"], stdout=PIPE, text=True)
simulink_status = simulink_status.stdout
nodered_status = nodered_status.stdout
subprocess.run(["systemctl", "stop", "go-simulink"])
subprocess.run(["systemctl", "stop", "nodered"])
run(["systemctl", "stop", "go-simulink"])
run(["systemctl", "stop", "nodered"])

#gather the current controller module configuration
subprocess.run(["node", "/usr/moduline/nodejs/module-info-gathering.js"])
run(["node", "/usr/moduline/nodejs/module-info-gathering.js"])

#get the configuration from the resulting file
with open("/usr/module-firmware/modules.txt", "r") as modules:
Expand All @@ -34,14 +34,14 @@ def upload_firmware(args):
info = info[:-1]

#get the newest available firmwares on the controller into an array
available_firmwares = glob.glob("/usr/module-firmware/" + "*.srec")
available_firmwares = glob("/usr/module-firmware/" + "*.srec")
newest_firmwares = []
hw_versions = []
for firmware in available_firmwares:
hw_version = firmware.split("/")[-1]
hw_versions.append("-".join(hw_version.split("-")[0:4]))
for hw_version in hw_versions:
firmwares_per_hw = glob.glob("/usr/module-firmware/" + hw_version + "*.srec")
firmwares_per_hw = glob("/usr/module-firmware/" + hw_version + "*.srec")
if len(firmwares_per_hw)>1:
firmwares_per_hw.sort()
newest_firmwares.append(firmwares_per_hw[-1])
Expand Down Expand Up @@ -95,6 +95,6 @@ def upload_firmware(args):

#restart simulink or nodered if they were turned on before the script
if not "in" in simulink_status:
subprocess.run(["systemctl", "start", "go-simulink"])
run(["systemctl", "start", "go-simulink"])
if not "in" in nodered_status:
subprocess.run(["systemctl", "start", "nodered"])
run(["systemctl", "start", "nodered"])
19 changes: 15 additions & 4 deletions usr/moduline/python/parse_a2l.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from pyuio import asap_datatypes
import json
from json import dumps as dump_json
from subprocess import run
from glob import glob
from os import path

reached_end = False
reading_parameter = False
Expand All @@ -9,7 +11,16 @@
signals = {}
size = 1

with open("/usr/simulink/gocontroll.a2l", "r") as a2l:
a2lLoc = glob("/usr/simulink/*.a2l")

try:
a2lLoc = max(a2lLoc, key=path.getctime)
except:
print("No a2l file present in /usr/simulink")
exit()


with open(a2lLoc, "r") as a2l:
while not reached_end:
line = a2l.readline()
if reading_parameter or reading_signal:
Expand Down Expand Up @@ -81,11 +92,11 @@
elif "COMPU_METHOD" in line:
reached_end=True

json_parameters = json.dumps(parameters, indent=4)
json_parameters = dump_json(parameters, indent=4)
with open("/usr/simulink/parameters.json", "w") as parameterFile:
parameterFile.write(json_parameters)
run(["cp", "/usr/simulink/parameters.json", "/usr/node-red-static/parameters.json"])
json_signals = json.dumps(signals, indent=4)
json_signals = dump_json(signals, indent=4)
with open("/usr/simulink/signals.json", "w") as signalFile:
signalFile.write(json_signals)
run(["cp", "/usr/simulink/signals.json", "/usr/node-red-static/signals.json"])
Expand Down
7 changes: 6 additions & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
V1.9.31
V1.9.32

########
26-1-2023 V1.9.32 Release 0.3.14
fixed the MAC address of the bluetooth module
fixed update scripts to handle added files better and to not overwrite configurations in /etc/
added current based peak and hold for the output module in firmware 1.3.2

23-1-2023 V1.9.31
fixed the bluetooth name in the first install script.
fixed the bluetooth startup for the GOcontroll display controller.
Expand Down

0 comments on commit 7445a5d

Please sign in to comment.