Your error - it looks like you are using the wrong uplink key. Are you sure the uplink code connect key matches the one shown in in the IDE?
What’s the time difference between the “connection open” and the key error? I’ve not tried this yet, but do you get the same effect if you make the key in the uplink connect complete nonsense (eg “GGGGGGGGG”)? I’m wondering if the connection message happens anyway before the key is authed.
You may have to post a little more info if I have misunderstood.
The link works very well for about 12 hours, but when I come back to the computer after being away it seems to be in this state. I was wondering if there is a time out or something?
Whatever the cause I need a find a fix so that the channel can rely on the controls 24/7
Is it a laptop?
Maybe a problem with some power saving/sleeping/relaxing going on?
My uplinks usually stay up for days or weeks without problems. They are also able to reconnect after the internet comes back up after Anvil unrelated connection problems.
Once in a while they can’t reconnect, maybe once a month, and I just reboot my dedicated-no-powersaving-no-laptop computer. I will eventually setup a nightly automatic reboot, but for now I’m happy.
Hi @michaellavers, thanks for letting us know about this, and for your video which shows the issue very clearly.
I notice in the video that your script has this line in it:
anvil.server.connect('<your uplink key here>')
That will cause the connection error you’ve reported - the '<your uplink key here>' needs to be replaced with a unique key for your app, provided by Anvil. The Uplink uses that key to identify which app it’s connecting to.
You can find the key in the Gear Menu:
You’ll get a dialog like this, you press a button marked ‘Enable uplink for this app’, and then the key is generated:
This doesn’t necessarily explain the intermittancy you’re seeing. I’m thinking you might have two anvil.server.connect lines in your script: one that contains the correct Uplink key, and one with '<your uplink key here>'. Is that correct?