B4R Tutorial ESP8266 - Getting Started

Discussion in 'B4R Tutorials' started by Erel, Jul 7, 2016.

  1. Erel

    Erel Administrator Staff Member Licensed User

    I've updated the socket example in the first post. It now uses B4RSerializator to send objects instead of bytes.
    The ESP8266 is implemented as a server. This allows making the connection without opening a port in Windows firewall.
    rwblinn and inakigarm like this.
  2. FrancisB

    FrancisB New Member Licensed 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:

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

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


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

    First try, first strike... :(
  3. Erel

    Erel Administrator Staff Member Licensed User

    Please start with the B4J example. There is no reason to use VB.Net.
  4. positrom2

    positrom2 Active Member Licensed 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
  5. Erel

    Erel Administrator Staff Member Licensed User

    The ip is wrong. It should be

    Please post questions in the questions forum.
  6. FrancisB

    FrancisB New Member Licensed User

    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).

    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: Dec 2, 2016
  7. FrancisB

    FrancisB New Member Licensed User

    Finally... I has been able to connect, seems to be a Tomato router firmware limitation... Done!
    Peter Simpson likes this.
  8. Humberto

    Humberto Active Member Licensed User


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


    B4R version: 1.80
    Parsing code.    (
    Compiling code.    (
    Building project    (
    Compiling & deploying Ino project (NodeMCU 
    0.9 (ESP-12 Module) - COM10)    (34.86s)
    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.
  9. Erel

    Erel Administrator Staff Member Licensed User

    Can you post a screenshot of the board selector window?
  10. Humberto

    Humberto Active Member Licensed User

    I configure in Arduino IDE and try some examples and works

    Attached Files:

  11. Toley

    Toley Active Member Licensed 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
  12. Humberto

    Humberto Active Member Licensed 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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice