B4R Tutorial ESP8266 - Getting Started

FrancisB

New Member
Licensed User
Longtime User
I tried your simple example and I'm just not able to connect...

I got what was expected form the ESP8266:
Connected to wireless network.
My ip: 192.168.1.108



I tried a very very small VB.Net test as:

Imports System.Net
...
Dim Sck As New Sockets.TcpClient
Sck.Connect(IPAddress.Parse("192.168.1.108"), 51042)


...
TIMEOUT ERROR

I verified my firewall and the port is open in private and domain...

First try, first strike...
 

positrom2

Active Member
Licensed User
Longtime User
While ago Erel's examples on B4R/B4J worked. Not anymore.
The port 51042 is open for ingoing, outgoing, TCP and UDP (all private).
The B4J error reads:
java.net.UnknownHostException: 192,168,178,20
...
 

FrancisB

New Member
Licensed User
Longtime User
Please start with the B4J example. There is no reason to use VB.Net.

Hahahaha
I'm basically a senior .Net programmer. But unrelated to the programming language we use, it should work on any kind of TCP-IP connection.

You know what? I tried also B4J without more success...
java.net.ConnectException: Connection timed out: connect

I used Arduino C/C++ since a few weeks, it works pretty well, the big deal, the OOP is very basic, I have the feeling to return in my old DOS time without the interrupts. Your approach is more OOP (like NodeMcu/Lua). But without a small connection success...

By the way, I use the new Arduino IDE 1.6.13 (looks working well with B4R).

Francis
P.S.: I use the same development board WEMOS D1, it works very well with: Arduino C/C++, NodeMCU, and next, I will look for esp8266basic (who look as my old Vic20 or C=64, with a couple of strong options).
 
Last edited:

FrancisB

New Member
Licensed User
Longtime User
Hahahaha
I'm basically a senior .Net programmer. But unrelated to the programming language we use, it should work on any kind of TCP-IP connection.
...

Finally... I has been able to connect, seems to be a Tomato router firmware limitation... Done!
 

Humberto

Active Member
Licensed User
Longtime User
Hi

I´m trying this example and compile and install but I get no message in the log panel

Thanks


B4X:
B4R version: 1.80
Parsing code.    (0.00s)
Compiling code.    (0.04s)
Building project    (0.04s)
Compiling & deploying Ino project (NodeMCU 0.9 (ESP-12 Module) - COM10)    (34.86s)
    Looking for library 'user32'
    Adding paths from jna.library.path: null
    Trying user32.dll
    Found library 'user32' at user32.dll
    Looking for library 'shell32'
    Adding paths from jna.library.path: null
    Trying shell32.dll
    Found library 'shell32' at shell32.dll
    Looking for library 'Ole32'
    Adding paths from jna.library.path: null
    Trying Ole32.dll
    Found library 'Ole32' at Ole32.dll
    O sketch usa 238661 bytes (22%) de espaço de armazenamento para programas. O máximo são 1044464 bytes.
    Variáveis globais usam 33060 bytes (40%) de memória dinâmica, deixando 48860 bytes para variáveis locais. O máximo são 81920 bytes.
   
Completed successfully.
 

Humberto

Active Member
Licensed User
Longtime User
I configure in Arduino IDE and try some examples and works
 

Attachments

  • arduino.png
    22.5 KB · Views: 926
  • arduino_1.png
    53.9 KB · Views: 886
  • board.png
    16.1 KB · Views: 900
  • module.png
    383.3 KB · Views: 917

Toley

Active Member
Licensed User
Longtime User
Hi Humberto, the board you are showing is not a WeMos it's a nodeMCU. Don't know if it will solve the problem but it worth a try
 

Humberto

Active Member
Licensed User
Longtime User
I tryed with NodeMCu 0.9 and didn´t work then I change to this WeMos and works with Arduino IDE and now with B4R

Thanks
 

Herbert32

Active Member
Licensed User
Longtime User
as it is from 2016... - is this Tutorial already up to date ?

For usage with ESP8266 we should use Arduino-IDE 1.8.5 or can we also use more actual versions like 1.8.11 ?

is it still recommended to use esp8266 by ESP8266 Community in Version 2.4.2 or can also the actual version 2.6.3 be used ?
 

Peter Simpson

Expert
Licensed User
Longtime User

Yes to question 1
You can download and use the latest Arduino IDE if you wish to do so, that's what I do.

You can use any version.
 

hatzisn

Expert
Licensed User
Longtime User
Herbert32 see also the B4R version 3 release notes for the Esp8266 library you can install in your Arduino IDE to cooperate with B4R.
 

KiloBravo

Active Member
Licensed User
I am little rusty, but I downloaded B4R v3.30 and installed it. Still using Arduino-IDE 1.8.5.
I kept getting comm sync errors. So I updated the Arduino Boards Lib ESP8266 Community Version from 2.4.2 to 2.6.3.
That solved my problem. D1 Mini Pro. It has the older Si Labs CP210x USB to UART chip.
I know WEMOS uses the CH340 for a USB to UART chip now. YMMV
 

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
What message do you get when using this code?
Both clients for both the ESP8266 and the Android App connected to the Brocker MQTT successfully?
 

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
Ok, I see that you have no connection to the MQTT server.
Are you running the MQTT broker on your local computer?
And if so, keep in mind that all clients must be connected to the same local network
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…