monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
621 stars 144 forks source link

wifi.state not set until visiting WIFI menu #788

Closed okyeron closed 5 years ago

okyeron commented 5 years ago

When viewing menu.showstats the IP shows up as IP - until you visit the wifi page once.

wifi.state appears not to be set on first run.

okyeron commented 5 years ago

@tehn In startup.lua I tried moving wifi.init() into the norns.startup_status.ok callback function and it seems to then properly init wifi on start (I get REPL output of the connections from the wifi.init function). This in turn properly sets wifi.state

With wifi.init() as it currently stands in startup.lua , I don't see any of the wifi.init debug.

Not sure what the intended procedure is for wifi.init() on startup so I don't know if moving it around is good or bad.

tehn commented 5 years ago

startup_status_ok is dependent only on supercollider starting correctly, so it seems to be that wifi.init() just wants some sort of delay? i'll continue to investigate but would be interested if you find another approach

okyeron commented 5 years ago

FWIW - it looks like this ONLY happens on first launch at boot. doing ;restart from REPL and wifi init's just fine.

So maybe that needs to be in a callback in the same way norns.startup_status.ok is for boot?

okyeron commented 5 years ago

BTW - Is this duplication of norns.startup_status.ok (and norns.startup_status.timeout) OK? (since it's also [in startup.lua] (https://github.com/monome/norns/blob/6cf7c55bd0962ecffe7760113041fa4bfd6d5112/lua/core/startup.lua#L41) )

okyeron commented 5 years ago

Revisiting this today.

Is there any reason not to move wifi.init() into the norns.startup_status.ok callback function?

That seems to fix this issue.

tehn commented 5 years ago

want to send a PR? happy to test

tehn commented 5 years ago

fix by #861