Left here for archival purposes.

User avatar
By muralha
#39175 Hi devsaurus, thanks for the help.

So I've tried manually (ESPlorer) and with the "init.lua":
- disconnect
- sethostname
- config (with auto=0 and router mac address)
- connect

but I've run into some problems:

1 - with config with auto=0 and router mac address, I had some problems because it wouldn't register the auto=0 on wifi.sta.getconfig()?? but after adding wifi.sta.autoconnect(0) and removing the router's mac address and probably after a few resets, it registered...

2 - on Reset, the hostname returns to the previous name ... (NODE-F37086) and the router doesn't register that name but "Unknown-18-fe-34-f3-70-86"... (the router has others "Unknow-xx-xx-xx-xx-xx-xx", so probably it can handle it?)

3- after deleting the device from the router's list, sometimes I'm able the register the correct hostname

4 - the IPTV "hick-up" continues... (to not wait to much for the IPTV stream, it's easier to change the channel)

btw, my router is a "Technicolor / Thomson TG787"... crappy, but that's what we get from the ISP...

Any thoughts/ideas?
User avatar
By devsaurus
#39179 Hm, no - sorry. It was just a guess since the default name "ESP_xxxx" is said to cause issues. If you see the name you've set with wifi.sta.sethostname() but the issue persists... well, then we're barking up the wrong tree.
Just for reference, this is the code I use in init.lua:

Code: Select allwifi.sta.sethostname("MyOwnName")
wifi.setmode(wifi.STATION)
wifi.sta.config("Net1234567","mytestpassw", 0)
wifi.sta.connect()
User avatar
By muralha
#39188 I think I partially solved the "freeze" problem...
wifi.setphymode(mode)

Shouldn't be an auto detect for the WiFi physical mode?
Probably it was in N mode while my router is in B/G (still the grand majority are).

And one or more of this commands, freezes the stream:
Code: Select allprint(wifi.getchannel())
print(wifi.getmode())
print(wifi.getphymode())

function listap(t) -- (SSID : Authmode, RSSI, BSSID, Channel)
    print("\n\t\t\tSSID\t\t\t\t\tBSSID\t\t\t  RSSI\t\tAUTHMODE\t\tCHANNEL")
    for bssid,v in pairs(t) do
        local ssid, rssi, authmode, channel = string.match(v, "([^,]+),([^,]+),([^,]+),([^,]*)")
        print(string.format("%32.s",ssid).."\t"..bssid.."\t  "..rssi.."\t\t"..authmode.."\t\t\t"..channel)
    end
end
wifi.sta.getap(1, listap)

print(wifi.sta.getbroadcast())
print(wifi.sta.getconfig())
print(wifi.sta.gethostname())
print(wifi.sta.getip())
print(wifi.sta.getmac())
print(wifi.sta.status())


I'll run some more tests.
User avatar
By muralha
#39231 I think the main problems is being connect to the ESPlorer while doing this tests.
Sometimes sending multiple lines, overflows something and it freezes the stream.
Also connecting to soon to the board, freezes the stream... (boot ? / boot + connect ? / boot + connect + init.lua + other file ?)