Pi Local Server Questions

You have to put those files where the server.jar file, but yes, WinSCP or Filezilla will do that.

1 Like

One more question, in the bottom of server.properties is the following block. Should I change the default email and PW to my created project credentials, or will the Pi merely look in the mail.properties file for that info?

# default admin name and password. that will be created on initial server start
admin.email=admin@blynk.cc
admin.pass=admin

Edit - I used THIS VIDEO TUTORIAL to connect to the Pi with WinSCP and am linking it for the next readerā€™s benefit. I only mention that because I didnā€™t know the Pi was to remain powered and connected to access the directories.

Iā€™m still not able to login to the app with the credentials that are used in the mail.properties file.

First, have you created that user account ā€¦ through the App. May not explain the connection error, but first things first :wink:

The server properties files are not how you create a user account, only for setting up an administrator account and email service.

No, I created the account from my PC to take advantage of the physical keyboard. Is it a prerequisite to create the account ā€œthroughā€ the app? If yes, I presume Iā€™ll need to alter the credentials is the mail.properties file?

Yesā€¦ since you could theoretically have thousands of different accounts on your one server.

Whatever credentials you put there are the servers ā€œadministrativeā€ email serviceā€¦ that sends all those theoretical thousands of user accounts the emails with their requested Auth tokens, CSV files, etc.

Generally for a single home user, it would be the same email address used for both :stuck_out_tongue_winking_eye:

It still wonā€™t login with new credentials. Also, Iā€™d like to point out that you canā€™t actually create a new account with Blynk app. The best you can do is login with a previously created email address. I know that sounds like a play in semantics, but itā€™s not meant as such. Still, I tried to login with one of my other email addresses that is not registered to blynk.cc and still the app wonā€™t connect to the pi server on the staticIP/9443.

You most certainly can!!ā€¦ That is the whole purpose of that ā€œCreate New Accountā€ option in the App :wink: Works the same with Cloud or Local Servers

Whatever your issues are, are related to something messed up in your setup of your Local Server.

1 Like

Each and every server is completely isolated from all other serversā€¦ so any credentials you do or donā€™t have in Cloud Server is irrelevant in your Local Serverā€¦ even if you use the same info. They are separate accounts and must first be created, via the App that is connected to that server, before you can log in and start using it.

Iā€™m in finally, thanks @Gunner, @Lichtsignaal, @Costas. I was using an outdated jar and also I forgot to launch it, duuhhh! Still, I need to update my Auto Start script so it launches after powering up. At any rate, thanks for all the help!

2 Likes

Wuppsā€¦ yes, that does seem to be a requirementā€¦ :stuck_out_tongue_winking_eye:

Tempora mutantur, nos et mutamur in illis

Except @Gunner because he is a :sauropod:

:smile:

That is Mr. Master :sauropod: Sir! :stuck_out_tongue_winking_eye:

Iā€™m almost there. Server is running, my app connects to it and everything, but my hardware it seems only makes a momentary connection as the Online Status icon shows the Device Offline since (time of upload) which suggests to me that it connected, if only for a moment. Here is my basic sketch for an ESP8266 and a DHT22 sensor. If I uncomment the CLOUD credentials, it connects to my other account and displays the sensor readings as coded for, but my LOCAL credentials arenā€™t functioning properly. Does my sketch have any noticeable errors? If no, can anybody think of something I should look into? Everything has been updated to current, app/library/server.jar.



//#define BLYNK_PRINT Serial    // Comment this out to     disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
//char auth[] = "CLOUD_KEY";   // Cloud Server
char auth[] = "LOCAL_KEY"; // Local Server
char ssid[] = "NETWORK_NAME";
char pass[] = "PASSWORD";
byte arduino_mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress device_ip ( 10,   0,   0,  80);
IPAddress server_ip ( 10, 0, 0, 130 );      //IP of machine server runs on
IPAddress gateway_ip ( 10,   0,   0,   1);
IPAddress subnet_mask(255, 255, 255, 0);

#include <DHT.h>
#define DHTPIN 2 //pin gpio 12 in sensor
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;

void readSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(true);

  Blynk.virtualWrite(V0, t); // virtual pin
  Blynk.virtualWrite(V1, h); // virtual pin
}

void setup()
{
  Serial.begin(115200);
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442); // Cloud Server
  Blynk.begin(auth, ssid, pass, server_ip, 8442); // Local Server
  
    // Setup WiFi network
  WiFi.config(device_ip, gateway_ip, subnet_mask);
  WiFi.begin(ssid, pass);

  // Setup Blynk
  Blynk.config(auth);
  while (Blynk.connect() == false) {
  }
  dht.begin();
  timer.setInterval(3000, readSensor);     //Read every 3 secs
}

void loop() {
  Blynk.run();
  timer.run();
}

I am sure it has been discussed earlierā€¦ but I donā€™t see the reason for most of this with an ESP (except the server IP)ā€¦ the router should take care of it and any static IP settings you need.

Both Blynk.begin() and Blynk.config() with WiFi.config() in the middle for good measureā€¦ your poor device probably doesnā€™t know what to do :stuck_out_tongue:

And this is totally unnecessaryā€¦ as well as being a potentialy locked loop

3 Likes

Thanks again @Gunner! I commented the WiFi.config() and the while loop and it connected immediately. Thanks again sir!

When trying to add the script to rc.local via SSH

sudo nano /etc/rc.local

I paste in the auto start script, then Ctrl/X, then Y, I get this screen and I donā€™t know how to proceed. In a previous attempt I tried to add the instruction to ā€œappendā€, but this just created another file below the original titled rc.local.save. Can someone advise how to proceed to be able to execute the server auto start after booting?

CTRL-O to save (or rename if needed), then enter <-- you are at this stage alreadyā€¦ so just hit enter.

Followed by

CTRL-X to exit

Then simply type sudo /etc/rc.local to manually start it, or sudo reboot to reboot the system and test if it automatically starts

1 Like

As always Gunner, thank you!!