Notifications
Clear all

Any Experience with Installation of Heltec ESP 32 Development Boards???

23 Posts
2 Users
0 Likes
2,497 Views
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@farzad_k

Just some observations. All based of course on a very incomplete understanding of what you are up to and in the certain knowledge I sometimes spout a lot of nonsense.

You have a portable router (an access point) and it may be best if your PC and all your other boards, like an ESP32, that have wifi all use the same access point (your portable router) so they can all communicate with each other via their own ip address on the network your router creates.

You can set up an ESP32 to be an access point (a mini router) but your other 'things' would then need to select the ESP32' access point, and disconnect from the portable routers access point. I don't think ESP's would really make a good reliable router and you would need to set up a watchdog arrangement to automatically reboot the ESP32 if it goes down.

You have, or will have, an Arduino to control a heater in some fashion. You mention having a wifi access point to double duty. Double duty for what, your Arduino or your portable router as I assumed above? I don't yet see any reason to operate your ESP32 as an access point in your set up. (plenty of good reasons to communicate twixt PC and ESP32 of course, but just as another ip address on the same network with all the rest) Of course don't forget that the Arduino pins are 5v logic level whereas the ESP32 is at 3.3v. This may or may not have implication for whatever you are doing with your heater.

I see that an OLED display would be good, and indeed you could program your arduino or esp32 board to output info to an such a display. You have chosen an esp32 board that incorporates an OLED display, which just means some pins on the esp32 are connected to the pins on the OLED display to save you having to manually wire one up. I hope your board comes with info as to what pins they chose to wire up to the OLED display and has info on the libraries needed to drive the OLED display.

As a PC is running your telescope set up, then I would think that it would be good to send / receive information from the PC and your ESP32. There are a number of ways to do this, but communicating with http commands over your portable router network is one good way.

Why do you call it a portable router I wonder. This sort of indicates you move it around. Why not just dedicate a router for the task. I have a long ethernet cable to link my house router to a remote router so I can get a good remote wifi access at the remote spot. The remote router uses the home router as its access point so my devices at the remote location are all part of the same home network setup. In this sort of set up your ESP32 with its pretty OLED display could be set up either in the house or at the remote location, it would not care

A lot of 'things' come with the ability to connect to their own access point and incorporate their own web server. This is usually so you can connect to the device in order to set up the wifi details of your home network (you SID and PW), and then it will revert to station mode and become just another node on your home network. I don't know in what context your ESP32 as an Access Point relates to.

So, these a just some random thoughts about your project that entered my head. Happy coding 😀  


   
ReplyQuote
(@farzad_k)
Member
Joined: 3 years ago
Posts: 75
Topic starter  

@byron, great thoughts greatly appreciated.

Posted by: @byron

Why do you call it a portable router I wonder.

The most exciting deep space imaging takes place in remote locations and usually not from home especially if one lives in a light-polluted area or the skies are obstructed by trees and other structures. In the remote field we need the router to setup a local network, and we need to have trained our PC's to connect to that router when it is near by.

Posted by: @byron

Why not just dedicate a router for the task.

I am already doing that using this field router. I am hoping I can get an ESP32 microcontroller to do the job of that dedicated router. If you were going to dedicate a microcontroller like this one what else would you have it do?

 

Posted by: @byron

I see that an OLED display would be good, and indeed you could program your arduino or esp32 board to output info to an such a display.

Yes, if I can get it programmed, the onboard display, as opposed to a separate one would be more compact and very valuable. I would only need a tiny box large enough for the Heltec (or similar) to fit in.

 

Thanks for the input. I want to build a power source for the board to test various sketches on it. For one thing I want to see if it is not plugged into the PC and powered independently would it still say "connecting...failed" or not. I think reading the sketch can help me see what it is trying to connect to when it fails.

 

Farzad

 

 

 

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@farzad_k

The situation is a bit clearer.   Now I may be very wrong in this but I dont think the ESP32 can be used as a router.  It can be set up as an Access Point, and several different computers can be set to use it a an Access Point, though 'Access Point' in this context does not mean it can act as a router.   Usually the ESP32 Access Point is set up as a web server so the computers connected to it can issue HTTP requests and receive a response, often this is a web page etc. 

But I don't think it can link two computers together such as a router can do.  For example you could not expect a laptop computer to remotely connect to another computer via the ESP32 Access Point, it could only communicate with the AP's web server.  When I called the ESP32 an Access Point 'like a mini router' in my previous post I chose a bad analogy and did not mean to infer it would act as a proper router.

If you find I am mistaken, and I could well be, then please do let me know.

Also, say if it could be made to act as a router, albeit without the usual stuff like being an DHCP server etc, would the bandwidth and throughput speed be adequate to provide remote connection between computers in a network etc.

I see that you connect up your computers with the portable router you link to. Don't forget its possible to connect two computers together without any router, just using a cross-over cable.  Well I've never actually done this but I remember it as a possibility. 

Looking forward to hearing if there is any progress on your endeavours. 😀 


   
ReplyQuote
(@farzad_k)
Member
Joined: 3 years ago
Posts: 75
Topic starter  
Posted by: @byron

It can be set up as an Access Point, and several different computers can be set to use it a an Access Point, though 'Access Point' in this context does not mean it can act as a router.

Well, to me access point is access point - if various computers can be assigned an IP address, and the devices are configured for remote connectivity such as Remote Desktop available for Windows 10 Pro, then they should be able to be connected to via a computer. I think in the demonstrations of what access point is at the dronebot it appears like a central device to which other computers and devices can connect.

 

Posted by: @byron

Don't forget its possible to connect two computers together without any router, just using a cross-over cable.

Well, that is kind of difficult and I have never been able to do that, however, in the dark and cold you don't want wires and cables going yards and yards to your car or tent, etc. You want to connect using WiFi which is what I already do with the mini router I showed you.

 

Thanks again.

 

Farzad

 

 

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 
Posted by: @farzad_k

Well, to me access point is access point

Your info made me google 'is an access point a router'  Here is one of the responses

Wireless access point does not route anything. It just converts an existing wired network (LAN) into a wireless one (WLAN). A router can be a access point but a access point can't be a router.

So can an ESP32 be a router.  I'll leave you to google that one 😎   I hope it can, but I doubt.  Anyway good luck with your project. 👍 


   
ReplyQuote
(@farzad_k)
Member
Joined: 3 years ago
Posts: 75
Topic starter  
Posted by: @byron
Posted by: @farzad_k

Well, to me access point is access point

Your info made me google 'is an access point a router'  Here is one of the responses

Wireless access point does not route anything. It just converts an existing wired network (LAN) into a wireless one (WLAN). A router can be a access point but a access point can't be a router.

So can an ESP32 be a router.  I'll leave you to google that one 😎   I hope it can, but I doubt.  Anyway good luck with your project. 👍 

I tend to believe you. But I also read confusing stuff like what you can read here.

It says:

The ESP32 can act as a Wi-Fi station, as an access point, or both. 

In most projects with the ESP32, we connect the ESP32 to a wireless router...This way we can access the ESP32 through the local network. In this situation the router acts as an access point and the ESP32 is set as a station [basically another WiFi device on the network]. In this scenario, you need to be connected to your router (local network) to control the ESP32.

But if you set the ESP32 as an access point (hotspot), you can be connected to the ESP32 using any device with Wi-Fi capabilities without the need to connect to your router...when you set the ESP32 as an access point you create its own Wi-Fi network and nearby Wi-Fi devices (stations) can connect to it (like your smartphone or your computer).

I then actually went ahead and loaded an access point example sketch and lo and behold it actually works. I connected one of the PCs I use for my telescope to the network created by this sketch, made sure the PC is discoverable on that network, connected my main PC to that same network and then remoted into the PC just fine. I know most of the code below is not necessary for just getting the ESP32 to broadcast a WiFi network, and I should really copy this into a simpler one.

 

 

/*
WiFiAccessPoint.ino creates a WiFi access point and provides a web server on it.

Steps:
1. Connect to the access point "yourAp"
2. Point your web browser to  http://192.168.4.1/H  to turn the LED on or  http://192.168.4.1/L  to turn it off
OR
Run raw TCP "GET /H" and "GET /L" on PuTTY terminal with 192.168.4.1 as IP address and 80 as port

Created for arduino-esp32 on 04 July, 2018
by Elochukwu Ifediora (fedy0)
*/

#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiAP.h>

#define LED_BUILTIN 2 // Set the GPIO pin where you connected your test LED or comment this line out if your dev board has a built-in LED

// Set these to your desired credentials.
const char *ssid = "yourAP";
const char *password = "yourPassword";

WiFiServer server(80);


void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
Serial.println();
Serial.println("Configuring access point...");

// You can remove the password parameter if you want the AP to be open.
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.begin();

Serial.println("Server started");
}

void loop() {
WiFiClient client = server.available(); // listen for incoming clients

if (client) { // if you get a client,
Serial.println("New Client."); // print a message out the serial port
String currentLine = ""; // make a String to hold incoming data from the client
while (client.connected()) { // loop while the client's connected
if (client.available()) { // if there's bytes to read from the client,
char c = client.read(); // read a byte, then
Serial.write(c); // print it out the serial monitor
if (c == '\n') { // if the byte is a newline character

// if the current line is blank, you got two newline characters in a row.
// that's the end of the client HTTP request, so send a response:
if (currentLine.length() == 0) {
// HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
// and a content-type so the client knows what's coming, then a blank line:
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println();

// the content of the HTTP response follows the header:
client.print("Click <a href=\"/H\">here</a> to turn ON the LED.<br>");
client.print("Click <a href=\"/L\">here</a> to turn OFF the LED.<br>");

// The HTTP response ends with another blank line:
client.println();
// break out of the while loop:
break;
} else { // if you got a newline, then clear currentLine:
currentLine = "";
}
} else if (c != '\r') { // if you got anything else but a carriage return character,
currentLine += c; // add it to the end of the currentLine
}

// Check to see if the client request was "GET /H" or "GET /L":
if (currentLine.endsWith("GET /H")) {
digitalWrite(LED_BUILTIN, HIGH); // GET /H turns the LED on
}
if (currentLine.endsWith("GET /L")) {
digitalWrite(LED_BUILTIN, LOW); // GET /L turns the LED off
}
}
}
// close the connection:
client.stop();
Serial.println("Client Disconnected.");
}
}

 

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 
Posted by: @farzad_k

I tend to believe you

From what you have found your tendencies are in need of readjustment. 😉 

Good to find know that you can use your esp32 to link your computers and thanks for the code and link.  I’ll be having a go at setting up one of my esp32  boards one evening soon. It could come in to be very handy.

And you appear to have proved your esp board is working OK so a good days work to notch up as a success. 😀  


   
ReplyQuote
(@farzad_k)
Member
Joined: 3 years ago
Posts: 75
Topic starter  
Posted by: @byron
Posted by: @farzad_k

I tend to believe you

From what you have found your tendencies are in need of readjustment. 😉 

Good to find know that you can use your esp32 to link your computers and thanks for the code and link.  I’ll be having a go at setting up one of my esp32  boards one evening soon. It could come in to be very handy.

And you appear to have proved your esp board is working OK so a good days work to notch up as a success. 😀  

I am glad I found that the board can broadcast WiFi. But the signal is too weak. One of my astronomy computers is stronger at signal reception than the other, but still - neither of them work as well as when I use the TP-Link N300 Wireless Portable Nano Travel Router.

I don't think the broadcast signal could be strengthened through codes, and I think I might want to abandon the idea of integration of a control board and a WiFi AP and maybe find another way.

 

Farzad


   
ReplyQuote
Page 2 / 2