Other B4R v2.00 BETA is available for download

Discussion in 'B4R Questions' started by Erel, Jun 7, 2017.

  1. Erel

    Erel Administrator Staff Member Licensed User

    New features and improvements:
    The ESP32 SDK is more mature. Communication works perfectly.

    Download link: www.b4x.com/b4r/files/beta.exe
     
    gvoulg, Hypnos, ellpopeb4a and 6 others like this.
  2. Cableguy

    Cableguy Expert Licensed User

    Can you give an example on what "DefineExtra" does!?
     
    Peter Simpson and johndb like this.
  3. rbghongade

    rbghongade Active Member Licensed User

    Fantastic Erel! I shall begin testing with 40+ sensors and actuators that I have!
     
  4. rbghongade

    rbghongade Active Member Licensed User

    1)BLINK works ok!
    2)ANALOG READ works ok!
    3) Wifi is having a problem:
    Code:
    B4R version: 2.00 BETA #1
    Parsing code.    (
    0.01s)
    Compiling code.    (
    0.01s)
    Building project    (
    0.01s)
    Compiling & deploying Ino project (WEMOS LOLIN32 - COM32)    Error

    In file included from D:\DEVELO~1\WEMOS_~2\MLX916~1\Objects\bin\sketch\B4RDefines.h:26:0,
                     from D:\DEVELOPMENT WORK\WEMOS_ESP32\MLX91614_MQTT\Objects\src\src.ino:
    1:
    D:\DEVELO~
    1\WEMOS_~2\MLX916~1\Objects\bin\sketch\rESP8266WiFi.h:4:18: fatal error: WiFi.h: No such file or directory
    compilation terminated.
    exit status 1
    Error compiling 
    for board WEMOS LOLIN32.
    Even though the files are present in the folder it throws an error!
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Example: In this thread a user, using a non-standard Arduino, encountered an issue with memory alignment: https://www.b4x.com/android/forum/threads/numberformat-problem.79804/#post-505688

    The solution that I provided was to create a custom template file for the defines file. With the new feature it can be solved with this line:
    Code:
    #DefineExtra: #define B4R_MEMORY_ALIGNMENT 3
    The line as-is will be added to to global defines file and will override the previous value (0).

    Which folder? It should be:
    C:\Users\<user name>\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi
     
  6. kolbe

    kolbe Active Member Licensed User

    Made some initial test and no problems so far. The rESP8266wifi library is working for me. Connected to a AP and have a IP address.
     
  7. Cableguy

    Cableguy Expert Licensed User

    So, is there a list of the possible DefineExtra entries and it's values and effects?
     
  8. Peter Simpson

    Peter Simpson Expert Licensed User

    Thank you @Erel,
    It's looking good looking good looking good, I've just ordered some ESP32's :)
     
  9. Toley

    Toley Active Member Licensed User

    Hi Erel thanks for the update. Is there any specific libraries for the ESP32 or we should use the ESP8266 ones?
     
  10. kolbe

    kolbe Active Member Licensed User

    Used AsyncStreams in prefix mode + B4RSerializator to send data between B4A and B4J apps and all is working well.

    If I2C, UART and the OLED SSD1306 work it's off to the races!
     
  11. kolbe

    kolbe Active Member Licensed User

    I am using only the rESP8266WiFi library v1.30 and it works. There are no wifi.h files in my sketch folder or referenced in B4RDefines.h.

    Don't include rESP8266 either or it won't compile.

    Maybe clean project?
     
  12. rbghongade

    rbghongade Active Member Licensed User

    Dear kolbe,
    Still does not work with Wifi. Same error.
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    There is no such list available and you should normally not use it. This is a tool for me or other developers who develop libraries. In the future it will probably be used to customize the behavior of some libraries.

    You need to use the ESP8266 libraries.


    @rbghongade please start a new thread for this in the question forum. Also include the complete logs from the logs tab.
     
    Peter Simpson and Cableguy like this.
  14. Peter Simpson

    Peter Simpson Expert Licensed User

    I'll be testing the ESP32 support when I receive my ESP32's, but I really find the compilation and deployments logs extremely interesting.

    I've flashed some of the devices in my home with B4R 2.00 Beta #1 and I have not come across any issues whatsoever.

    Thank you for all the hard work that you put into B4R @Erel. For a free package B4R is just amazing...
     
    Erel likes this.
  15. Erel

    Erel Administrator Staff Member Licensed User

    The main reason for this feature is psychological. It makes the compilation step more interesting and less boring.
     
    rwblinn, rbghongade and Peter Simpson like this.
  16. rbghongade

    rbghongade Active Member Licensed User

    Dear friends,
    Just to update the test results:
    1)MQTT -OK
    2)DS18B20 (OneWire) -OK
    3)DHT22 -OK
    4)APDS9960-OK
    5)WS2812-OK
    6)ROTARY ENCODER-OK
    ....shall update again!
    Big thanks to Erel!
     
    Erel likes this.
  17. rwblinn

    rwblinn Well-Known Member Licensed User

    Hi,

    started to test with an ESP32 Dev Module
    LED Blink GPIO4 (IO4) - OK

    MQTT - OK
    [SOLVED] The behaviour below occurs if an already used client id is used to connect. See post #17 ( thanks to @rbghongade )

    Constant connect & disconnect from the broker, although able to send commands to the ESP from Domoticz Home Automation to trigger LED on or off.
    The Mosquitto MQTT broker runs on a Raspberry Pi 3. The program used is running fine on an ESP8266.
    Log Snippet
    Connected to wireless network with local IP 192.168.0.32
    MQTT: Connected to the broker
    {"idx":26, "nvalue":0, "svalue":"0"}
    {"idx":27, "nvalue":1, "svalue":"LED switched OFF"}
    LED set to 0
    Disconnected
    MQTT: Connected to the broker
    Disconnected
    MQTT: Connected to the broker
    Disconnected
    ... continuous connect = disconnect
    MQTT: Connected to the broker
    {"idx":26, "nvalue":0, "svalue":"0"}
    {"idx":27, "nvalue":1, "svalue":"LED switched OFF"}
    LED set to 0
    {"idx":26, "nvalue":0, "svalue":"1"}
    {"idx":27, "nvalue":4, "svalue":"LED switched ON"}
    LED set to 1
    Disconnected
    MQTT: Connected to the broker
    Disconnected
    MQTT: Connected to the broker
    Disconnected
    MQTT: Connected to the broker
    ... continuous connect = disconnect

    MQTT Code Snippet
    ' Check if connected to mqtt. if not, then try again after 1 sec
    Sub Mqtt_Connect(unused As Byte)
    mqttCO.Initialize("", "")
    If mqtt.Connect2(mqttCO) = False Then
    Log("MQTT Error: trying to connect again")
    CallSubPlus("Mqtt_Connect", 1000, 0)
    Return
    End If
    Log("MQTT: Connected to the broker")
    mqtt.Subscribe(mqttTopicLEDSet, 0)
    End Sub

    'MQTT New Message arrived
    Sub Mqtt_MessageArrived (Topic As String, Payload() As Byte)
    Dim bc As ByteConverter
    Log("MQTT: Message arrived. Topic=", Topic, ", Payload=", Payload)
    End Sub

    'MQTT disconnected. If the server is nor reachable, then MQTT is disconnected.
    Sub Mqtt_Disconnected
    Log("Disconnected")
    mqtt.Close
    Mqtt_Connect(0)
    End Sub
     
    Last edited: Jun 9, 2017
  18. rbghongade

    rbghongade Active Member Licensed User

    Dear rwblinn,
    I know you must have done it but please re-check if there are multiple esp devices trying to connect with same client name. This is a peculiar behaviour in such cases.
     
    Erel, Peter Simpson and rwblinn like this.
  19. rwblinn

    rwblinn Well-Known Member Licensed User

    You are SPOT on - forgot to switch off another ESP device with same client name. Great Help = Appreciated.
     
    Peter Simpson likes this.
  20. rbghongade

    rbghongade Active Member Licensed User

    Dear friends,
    Update continued...
    7)BMP280 -OK
    8)BME280 -OK
    9)HMC5883 -OK
    10)TCS34725 -OK
    11) SERVO S90 - NOT OK! ( library throws error that the MPU is not supported! However it works with ESP8266!)
    ...more updates coming up!!!
     
    Erel likes this.
Loading...
  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