Is it possible to connect to a node red dashboard without loging in
I have an issue in that my Pi running SignalK / node red regularly gets a different IP address when it connects to my Andriod phone hotspot. Apart from having to establish the IP address, it seems when I try to connect to my node red dashboard I have to re log in through signalk first, each time the ip address changes before I can connect to the dashboard. Am I right in thinking the login credentials are not remembered id the Pi ip changes? It is incredibly annoying that the Android phone hotspot subnet changes but there doesn't seem a way to round it so I wonder if there is something I can do to avoid having to go through the login process. I don't think I can use the hostname of the Pi, it seems I have to use the ip address in the browser.
20 Replies
Must be logged to see the dashboard
Credentials are stored in a COOKIE, which would be tied to the ip address
So are you saying that if the ip address of the pi changes then the credentials are lost and there is nothing I can do about it?
Yes
Unless you can setup a hostname/alias
COOKIES are tied to the ip or host name
OK thanks. At least I won't waste my time trying to find a solution.
Best solution is probably to get a WiFi router, so the ip does not change.
The problem is the phone is my only source for internet, so in order to connect to signalk and be able to do other internet things on the phone I have to connect the Pi to it, otherwise I would have the Pi as the access point. I don't think IPhones do this.
Some WiFi routers can handle this. Create a local network and forward everything to a hotspot.
For example, the MikroTic routers
I used to do this because my old hotspot from the cell provider only did WiFi.
I think you can do it with the pi too
I'm not sure I follow. My phone serves out an access point on a particular subnet, which changes, but the phone itself doesn't know/recognise the hostname of any device it creates an access point for so I can't connect the phone to anything other than by IP address. So if i want to connect my phone to a URL on the pi after having served out a new Ip address to the Pi I don't know how I can do it other than through the new IP address, hence having to log in again.
Not sure if that would all work if you phone is the hotspot and your trying to access sk from that same phone…
Ah. yes. See my response! It is a total PITA that Google won't allow you to fix the subnet.
It would definitely work with a router using the phone hotspot. But I think you would need another device to access sk
Yes. But then I would simply set the Pi up as the router if that worked. I think I am stumped and will have to log in each time. The Ip address usually stays for 24 hours at least.
Using something else, like KIP may be a solution too? I believe it will work without logging in.
You can also turn off security on the server. (Not the best solution IMHO)
Yes. But unfortunately KIP doesn't do mouse down/up events on Android. It's very specific, my issue.
Oh wait... how do I turn off security? That would work would it? I don't care about that.
GitHub
FAQ: Frequently Asked Questions
An implementation of a Signal K central server for boats. - SignalK/signalk-server
Ok Thanks. I'll investigate.
one not very good option is have the Pi both create a hotspot and log on to the phone at the same time with the onboard wifi adaptor, which is a bit unstable. Or maybe splash out on a usb wifi adaptor. I never have the Pi attached to internet unless doing an update so not a problem, though istr in the past setting a fixed ip address on the Pi, an Ai would explain how to do this.
The problem I have is that I want data from the Pi on my phone (such as AIS in Navionics) and to be able to reach the internet on my phone at the same time. The only way of doing this is to have the phone as the wifi network, otherwise I would happily set the pi up as the hotspot. Getting AIS via UDP works, especially as I broadcast it from a python script that detects the subnet change and is able to cope but now I am expanding into using node red the whole hotspot/subnet change becomes infuriating again. I have the node red issue solved but Kip and cookies falls down every time the ip changes. (Or signalk and login if authentication is enabled). Coupled with my phone choosing a non legal UK channel for 5Ghz hotspot it's enough to make me switch to Apple. (not really though)
setting a static ip address on the Pi worked ages ago when I had a play but android changes often, for a while you couldn't get at ssh or data through a phone hotspot from another device connected to the phone.
It's the subnet that changes with Android hotspot, so static IP isn't fesable. I'm wondering if there is something I can do with cookies, which I don't really know much about. I have created an app for my phone that scans the network to get the new Pi address and then uses an embedded browser to connect to the node red dashboard. That woks fine but Kip loses its locally stored settings every time the ip address changes. If I can solve that them I think I can live with it. I'm not concerned about disabling security since the Pi is connected to my Android hotspot network which is private and password protected. I don't imagine the Pi will ever connect to, say, a marina wifi and if it does then nosey people will be able to see the level of my water tank, but I don't mind. It's not a national secret.