And I'm gobsmacked it was done in the 22 mins between your two posts.
And I'm gobsmacked it was done in the 22 mins between your two posts.
Explore... Chat... Share...
Moderator: Mmiscool
'let local_name = "default" ' Default node name must be changed to something unique (currently not case sensitive)
let local_name = "MP3lounge" ' Unique node name
let system = "All" ' Allows different system groups of nodes to be addressed separately if required
udpbegin 5001
udpbranch [udpmsg]
wait
end
[udpmsg]
msg = udpread()
print "UDP msg received: " & msg ' For test purposes only
if left(upper(msg), len(name)) == upper(name) then goto [local_commands] ' handle specifically local "name" commands
if instr(upper(msg), upper(name)) > 0 then goto [group_commands] ' handle partial-name group commands
if left(upper(msg), 3) == upper(system) then goto [global_commands] ' handle this global "system"s node commands
print "msg not recognised by " & name ' For test purposes only
udpreply name & " ERROR: unrecognised msg: " & msg
return
[global_commands]
' (Sent prefixed by system, eg: "All ")
if instr(upper(msg), upper("?")) then goto [declare]
if instr(upper(msg), upper("Report")) then goto [report] 'change [branch] to report back something else
if instr(upper(msg), upper("Blink")) then goto [blink] 'for physically spotting the "system" nodes
if instr(upper(msg), upper("FlashIP")) then goto [flashIP] 'for physically identifying node IP addresses
if instr(upper(msg), upper("Reset")) then goto [reset] 'to reboot the complete "system"
udpreply name & " ERROR: no recognised global command in msg: " & msg
returm
[group_commands]
' (Sent to partial names, eg: "PIR ?" would be recognised by PIR1 and PIR2 and PIR3 etc)
print "Checking Group commands" 'For test purposes only
if instr(upper(msg), upper("GroupTest")) then print "Group test"
' if only interested in specific Group commands (partial local name) then uncomment return
' else drop through to also action local_commands
'return
[local_commands]
' (Sent to a specific unique node name)
print "Checking Local commands" 'For test purposes only
' Unique commands for this local node
' Subsequent print statements are test only, they should actually branch to appropriate subroutines, eg: goto [play]
if instr(msg,"PLAY") <> 0 then print "Play"
if instr(msg,"PAUSE") <> 0 then print "Pause"
if instr(msg,"NEXT") <> 0 then print "Next"
if instr(msg,"PREVIOUS") <> 0 then print "Previous"
if instr(msg,"VUP") <> 0 then print "Volume Up"
if instr(msg,"VDOWN") <> 0 then print "Volume Down"
' Common commands for all system nodes
if instr(upper(msg), upper("Report")) then goto [report]
if instr(upper(msg), upper("Blink")) then goto [blink]
if instr(upper(msg)A, upper("FlashIP")) then goto [flashIP]
if instr(upper(msg), upper("Reset")) then goto [reset]
udpreply name & " ERROR: no recognised local command in msg: " & msg
return
[declare]
udpreply name
return
[report]
udpreply name ' change name to whatever info needs to be sent back
return
[blink]
print "cause GPIO01 led to blink"
return
[flashIP]
print "cause GPIO01 led to flash the significant last IP address byte"
return
[reset]
print "cause node to reset"
return
[button]
' Broadcast system nodes to declare themselves (Who's there)
print "GPIO00 button pressed"
return
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]