Moving Server Cloud to Local - App-side Login Problem

Hi,

Decided to go for the local server after messing about with the cloud (uni firewalls being a pain) and I’ve set up as the docs and other topics suggest. It seems to work from the device point of view, but I can’t log in from the app - it gets stuck at reconnecting to server... and so I can’t get valid auth tokens to run anything for it. Where should I start looking for a solution? I have enough signal from the app side, network connection isn’t a problem. Using the Blynk cloud with my account is fine too.

Using server version 0.23.0, app version 2.10.1, phone is Samsung Galaxy SII, Arduino MKR1000.

Serial monitor (debug enabled) gives

[2264] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.4 on Arduino MKR1000
[5001] Connecting to 192.168.137.001:8442
[5010] <[02|00|01|00] 
[5012] <85e58479ff454328bd139c2fc148199c
[5083] >[00|00|01|00|09]
[5084] Invalid auth token
[10017] Connecting to 192.168.137.001:8442
[10025] <[02|00|01|00] 
[10028] <85e58479ff454328bd139c2fc148199c
[10039] >[00|00|01|00|09]
[10040] Invalid auth token
...

The app side is using 8443, both ports (8442 and 8443) are allowed through the firewall. Using the same IP for app and IDE :stuck_out_tongue:

Hello. What IP did you put in app? Are your app in same network as server?

Did you create a new account?

I set up an access point on the same laptop I’m running my server on, using that wireless network’s IP as the server IP I’m using. The app/phone itself isn’t connected to the AP but the Arduino is

Where it is connected to?

No I didn’t… is that needed for each time I move server? I thought I’d keep my energy if I used the same account

It is needed when you create your own server. Local and Blynk cloud not connected.

Phone is connected to the university wifi network - the same network my laptop’s using to create the access point - or just mobile data

Oh right, okay. I’ll try that and let you know how it goes, thank you :slight_smile: so energy is server-specific, because you need to change accounts with each server move. That’s right, isn’t it?

Right.

1 Like

celebrates wildly thank you!

Both server and account specific… but not really an issue on the Local Server side as you (Local Server Admin) will have full control over energy allocation.

It’s still having trouble, the app’s hanging on creating a new account.

I checked the server postgres file, and I’m getting this error:

2017-03-07 10:56:36.636 - DB user : test
2017-03-07 10:56:36.637 - Connecting to DB...
2017-03-07 10:56:38.727 - Not able connect to DB. Skipping. Reason : Failed to initialize pool: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Sounds like I’ve half-arsed the server set-up somehow (aside from needing to update the certs, I still don’t know how to do that yet). Would you mind giving me pointers on where to go/what to research from here? I may have bitten off more than I can chew.

EDIT: looking at “How To Configure Blynk Server” at the minute, it’s a bit difficult to follow.

You may ignore this error.

Thank you.

I’m still having problems. New accounts still hang on connecting in the Blynk app, whether I use a different email address or not. Eventually the line reconnecting to server appears, and doesn’t go away.

Would it help if I connected the app to the same network as the Arduino? As in, connect them both to the laptop access point?

Yes, that is generally how it needs to work, at least until you have tweaked all of your router’s port forwarding and so on, for authorised WAN side access to your local server.

1 Like

It shouldn’t matter when you’re building the control panel though, right? But noted for when this problem’s solved!

Control panel? Do you mean your project in the App on the phone… if so, then yes it matters greatly as your project gets stored on, authenticated by and directed too the appropriate hardware, via the server. Thus you need to create a login first to make a project, and to do so you need to access the specific server you will be using.

1 Like

Yes, I did mean that! What would you call it, a GUI?

I also did not know that, thank you. It doesn’t seem to help though, I’m still not able to log in.

Does it make things more complicated that my server machine is also the machine generating the wireless network my phone and Arduino are connecting to here, or is that not an issue?

OK… lots to think about… does the machine that is your server, PC, router, access point, etc… also make coffee? :smiley:

Joking aside… and also aside from reminding that Local Server is for advanced users… I would say that you are indeed adding to the complication by using multi-purpose devices before getting a firm grasp on the basics.

I don’t have a simple solution, except to recommend you fall back to Cloud Server and spend a lot of time reading around the documents and forum on this topic before progressing to Local Server.