[SOLVED] Config/Setup for PHOTON WiFi bridge connection to LOCAL SERVER

@LZHenry I was thinking Comcast was the brand of router but I now think this is your service provider. Can you provide details of the exact make and model of your router.

@Gunner @Costas

Today’s work has focused on the server not communicating properly. ( I understand you would like me to switch to LINIX, but I am old and resist “new” trends.) If you have the patience… please comment on the following.

Overview

  • PC where server is hosted CAN connect to the ADMIN screens (https://10.0.0.166:9443/admin)
  • Laptop on my wireless net CAN NOT connect
  • And obviously, Phone APP can not connect.

Implemented Port Forwarding at the Comcast modem model AARIS TG 1682G

Directory WARNING Fixed
Fixed the server start warning by properly adding my server directory into the cmd file
java -jar %latestjar% -dataFolder D:\BLYNK_Server_Data

SSL Certificate Warnings NOT fixed; will fix as knowledge increases. Is this needed before APP or remote PC will talk???

Server.Properties
YOUR QUESTION “When you created the local server did to set up server.properties and mail.properties? “

Added the properties file, but have not yet edited much yet; working on that tonight.

ISSUE: Server Exits Improperly

  • Start the server … Using the Waleed El-Badry cmd file.
  • Server starts and dos window remains “up”
  • If the dos window is closed, the server EXITS!
  • Do not know why; do not think this was the action “yesterday”
    *** Comments welcomed to aid with learning**

Logical questions seeking wisdom

  • Why are tokens needed for a LOCAL network.
  • I want to talk PHOTON >>> PHOTON
  • Assumed I could use ANY number I wanted?

If the answer to the above is “FW needs a properly hashed number” then
Why do I need a NEW token with a NEW account specifically for LOCAL nets???

After tonight, traveling for the week and will not get back to project work for a few days.
Thanks for continuing to help with issues that are probably boring to you.




Server Startup Data Follows


Starting HZ Blynk Server
Script created by
Waleed El-Badry
waleed.elbadry@must.edu.eg


Your working directory is D:\BLYNK_Server_Data\



Local Server IP Address is: 10.0.0.166
Hardware Port : 8442
Application Port : 8443


Available server files
Volume in drive D is H BOOT 1TB
Volume Serial Number is D068-4CDD

Directory of D:\BLYNK_Server_Data

07/06/17 08:52 PM 16,806,240 server-0.25.3.jar
1 File(s) 16,806,240 bytes
0 Dir(s) 471,473,258,496 bytes free

D:\BLYNK_Server_Data>echo Server latest version on folder is server-0.25.3.jar
Server latest version on folder is server-0.25.3.jar

D:\BLYNK_Server_Data>rem R fixed to the BELOW

D:\BLYNK_Server_Data>java -jar server-0.25.3.jar -dataFolder D:\BLYNK_Server_Data -serverConfig D:\BLYNK_Server_Data\HZServer.properties

Blynk Server 0.25.3 successfully started.
All server output is stored in folder ‘D:\BLYNK_Server_Data.\logs’ file.

Blynk.log Data follows

18:26:22.097 INFO - Using data dir ‘D:\BLYNK_Server_Data’
18:26:22.472 INFO - Region : local
18:26:22.864 INFO - Initializing gmail smtp mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
18:26:22.894 INFO - Didn’t find custom user certificates.
18:26:22.894 INFO - Didn’t find Let’s Encrypt certificates.
18:26:22.894 WARN - You didn’t specified ‘server.host’ or ‘contact.email’ properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
18:26:22.894 WARN - ATTENTION. Server certificate paths (cert : ‘D:\BLYNK_Server_Data’, key : ‘D:\BLYNK_Server_Data’) not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
18:26:23.347 INFO - Hardware plain tcp/ip server listening at 8442 port.
18:26:23.347 INFO - Hardware SSL server listening at 8441 port.
18:26:23.347 INFO - Application server listening at 8443 port.
18:26:23.347 INFO - HTTP API and WebSockets server listening at 8080 port.
18:26:23.347 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
18:26:23.347 INFO - Mqtt hardware server listening at 8440 port.

NOTE: Occasionally this last WARN appears???

17:53:05.822 WARN - No order field ‘id’

There used to be an entry in server.properties towards the end of the file that granted access to the admin panel. Originally it was localhost 127.0.0.1 only and that is why your PC would connect but nothing else. I thought this restriction had been removed when the password was added to access the admin area. Worth you checking this though.

Certs don’t need to be fixed yet.

Do you have a link to the Waleed Ed-Badry script?
I suspect the Dos window should be kept open.

Because that’s how the system works, your Photon interfaces via the server and your local server is a totally different server to the Blynk server you were originally using. Therefore your new local server knows nothing about any projects / accounts / token until you create them anew.

They are effectively identifiers between the Project, Server and MCU hardware… make data go where it should (remember a Server can host hundreds of users and projects) to make them work differently could effectively change the whole architecture of how Blynk works.

As the Server is central to the whole AppServerHardware infrastructure, each Server (which by definition is the generator and overseer of the Auth codes) can only use it’s own generated codes, not ones that are generated by another completely differing server. It is a very closed in clique :slight_smile:

The “local server” is not necessarily local and can be anywhere in the world, it’s just a different server to the official Blynk servers around the world.
It’s not related to FW hashing it’s simply a security measure that applies to using the server, locally or otherwise.

You can… (it is called bridge) but it has to all go through a server.

       App
        |
     SERVER
    /      \
Photon      Photon

@Gunner
I think I am understanding at about 90% you last several discussions of server operation.

New thought.
The code was to use BRIDGE.

I was intending to operate my SERVER WITHOUT internet connection.

I “imagined” Photon-BRIDGE1 could directly communicate to Photon1-Bridge1 without server???

Does this change any of your previous thoughts???

Ahh… Lights ON :bulb: I guess you are then running your Local Server on a PC (it probably states that somewhere above… but … lazy ;P)

Check your Firewall and AntiVirus… I recently helped another user through that painful discovery process.

@Gunner
Link…

and

I am going off to look at this.

My assumption … all my previous BLYNK interface and code operated… was “thinking” this new interface would also NOT be blocked. Typically, the FW & AVirus ask me to allow things, then I click to allow the exceptions.

Now off to your past example.

As long as everything is on the same network, internet is not required.

But Bridge (along with most everything Blynk), DOES require a server… BT/BLE is a rare exception between App and Hardware (and only supports some Widgets), but still requires the App to connect to a server for login and Auth code generation.

EDIT - And @Costas is correct, the DOS Window MUST stay running, in background (minimised) at least.

Don’t rely on that… it didn’t help that other user :wink: Best to manually allow server full network access in both FW and AV

The default is now 0.0.0.0/0,::/0 so as long as you haven’t changed this in server.properties then any machine on your network should be able to access the local Blynk server. But as pointed out by @Gunner you need to check firewall and antivirus isn’t blocking the ports etc.

@Costas

Education… do we know why dos must be open?

Because that’s how Bill’s folk wrote Windows software, close a Window and the software stops.

@Gunner

SUCCESS…. Removed the Firewall and now ALL connect. New BLYNK project and tokens created. Thank you BOTH for sticking with this.Firewall back at full strength until I can learn how to allow BLYNK to peak through without turning the FW off.

Education: Still a long way to go. Want to ask again about the new tokens I created. Since they are “registered” to my Email and my IP 10.0.0.166, If I CHANGE my local hard-coded ip in the Comcast modem, will the tokens stop operating??? Or asking different, is the ip hashed into the token with other information, or is it simply a unique identifier?

I do not think there is a detailed description of the interface available to describe this level of understanding, so I need to ask you two.

1 Like

Truthfully, that works the same for a CLI window into a Linux device as well, just a different procedure to “minimise” it (and yes I am generalizing the similarities) :wink:

Glad you got it working !! :sweat_smile:

The Auth tokens are linked to your account in the server, as are any projects. Your servers IP will have no direct affect on them, but you will need to change any such IP in both your App and Sketches.

Think of it as having the keys to your car in your hand, but also needing to remember where you parked it in order to properly use it :stuck_out_tongue_winking_eye:

LOL @Gunner
I’m glad my bad experience helped others.

but on the same note… can anyone add to the docs to do this so people won’t get stuck on some technical issues for nothing… just add 2 lines to the blynk docs that says to check for the FW and antivirus…

just an idea.
happy blynking.

1 Like

Good idea… @Dmitriy? This is probably more in reference to a Windows based Local Server.