udo1toni hat geschrieben: ↑9. Mai 2020 18:54
Wenn Du VSCode hast, kannst Du einfach PlatformIO als Plugin installieren.
Hallo Udo,
erst mal Danke für deinen Input. Ich habe auf meinem alten LapTop AtomIO mit PlatformIO installiert und dort habe ich damals (vor ca. 1 1/2 Jahren) meine Sonoffs geflasht. Das ging auch soweit ganz gut, nach meinem Verständnis haben die aber alle die gleiche Source, oder ? Und Mithilfe von Thom Dietrich und Opus habe ich es dann auch geschafft meine Sonoffs per OTA (Rule) zu updaten.
Die Regel sieht so aus:
Code: Alles auswählen
// Work with a list of selected Sonoff modules
//
val sonoff_device_ids = newArrayList(
// "schaltdose03",
// "pow_02",
"schaltdose04"
)
// OR
// Work with the grouptopic, addressing ALL modules at once
// val sonoff_device_ids = newArrayList("sonoffs", "tasmotas")
// https://community.openhab.org/t/using-sonoff-power-switches-with-tasmota-firmware-and-openhab2-mqtt2-binding/59969/7 // thx to @opus
rule "Sonoff Maintenance"
when
Item Sonoff_Action received command
then
// logInfo("sonoff_maintenance", "Sonoff Maintenance on all devices: " + receivedCommand)
val actionsBroker = getActions("mqtt","mqtt:broker:hans") // change to your broker name!
for (String device_id : sonoff_device_ids) {
switch (receivedCommand) {
case "restart" : {
actionsBroker.publishMQTT( "cmnd/" + device_id + "/restart", "1")
logInfo("sonoff_maintenance", "Sonoff Maintenance: " + device_id + " / " + receivedCommand + " / " + sonoff_device_ids)
}
case "queryFW" : {
actionsBroker.publishMQTT( "cmnd/" + device_id + "/status", "2")
logInfo("sonoff_maintenance", "Sonoff Maintenance: " + device_id + " / " + receivedCommand + " / " + sonoff_device_ids)
}
case "upgrade" : {
actionsBroker.publishMQTT( "cmnd/" + device_id +"/otaurl", "http://thehackbox.org/tasmota/release/tasmota-DE.bin") // my modification, as for me this URL seems the better one -> tasmota
actionsBroker.publishMQTT( "cmnd/" + device_id + "/upgrade", "1")
logInfo("sonoff_maintenance", "Sonoff Maintenance: " + device_id + " / " + receivedCommand + " / " + sonoff_device_ids)
}
}
}
// Sonoff_Action.postUpdate(NULL)
createTimer(now.plusSeconds(5), [ |
Sonoff_Action.postUpdate("OFF")
])
end
Ich denke die Rule kennst du ja.
Da greife ich doch auf eine Standard-"bin" zu und die ist soweit ich weiss auf 1MB-Chips ausgelegt(naiv wie ich bin

).
Die Nodes (Amica, Lolin, Wemos) haben aber alle schon 4MB und es geht noch weiter mit den ESP32.
Ich hab mir dann mal über GitPod eine bin generieren lassen, bei der man auch ein paar Einstellungen, wie bei PlatformIO (user,pwd) einstellen kann und natürlich, dass es sich dabei um einen ESP8266/4MB handelt. Dort wird dann das "bin" kompiliert du kannst es dann downloaden. Das hab ich mit der Version 8.1 von Tasmota gemacht und wollte dann auf 8.2 per OTA-Rule umsteigen und bin leider auf die Nase gefallen. Das ging nicht.
Ich hab dann wieder bei GitPod eine neue Version kompiliert und meinen Amica geflasht. Ok das ist nicht schwer, da man keine Adapter, etc. braucht. Aber ich muss das Teil halt jedes mal an den PC holen um ihn zu flashen.
Der Unterschied zu meinen Sonoffs, den ich mehr oder weniger durch das Posten mit Joe mitbekommen habe, ist die Tatsache, dass ich in meinem JSON-String u.a. den Teilstring "Vcc" ermitteln kann. Ich hatte mir davor gar keine grosse Gedanken gemacht, sondern hab mich gefreut, dass ich das wieder hab.
Ok, vielleicht geht auch ein Update über eine lokale .bin-Datei, das habe ich noch nicht ausprobiert. Die müsste ich dann aber wahrscheinlich auch wieder kompilieren.
Oder meinst du das ein Update mit der Standard-bin gehen müsste (evtl. über Minimal) und er trotzdem nachher weiss, dass er ein NodeMCU, oder was auch immer, mit 4 MB ist und auch einen Teilstring "Vcc" hat ??!!
Vielleicht denke ich auch zu kompliziert und es ist alles viel einfacher.