These are chat archives for SmingHub/Sming

18th
Mar 2016
slaff
@slaff
Mar 18 2016 07:55

Does anyone know how to set server and user for the mqtt client at runtime, in the example it is done in the constructor at compile time, but I would like to do it with values from appsettings.h

@linlun That is relatively straightforward: As a global variable in your application you declare a pointer to MqttClient

MqttClient *mqtt;

and then inside the function that you want to initialize the mqtt client object you write

void someFunction() {
       // .. here you read the config 
       mqtt = new MqttClient(<settings1...>);
       mqtt->connect(<other-settings>);

See this code example: https://github.com/slaff/Sming/blob/feature/axtls-dev/samples/MqttClient_Hello/app/application.cpp

hreintke
@hreintke
Mar 18 2016 14:55
@avr39-ripe :
Have the lwip compile running now. Can go into deeper investigation.
Alexander V. Ribchansky
@avr39-ripe
Mar 18 2016 14:56
@hreintke good news! and how you start compiling lwip? I try type "make" in rtos_sdk subdir and it just say that target "force" is done already... :(
any magic Makefile??
hreintke
@hreintke
Mar 18 2016 15:01

Took some time to find as my makefile knowledge is minimal. I hacked in the makefiles :
in makefile from sdk directory :

else
    AR = C:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar
    CC = C:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc
    NM = C:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-nm
    CPP = C:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++
    OBJCOPY = C:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-objcopy
    OBJDUMP = C:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-objdump
endif

In makefile from third_party

TARGET = eagle
#FLAVOR = release
FLAVOR = debug

SDK_PATH=/c/Userdata/ESP8266_RTOS_SDK_LWIP
PDIR=/c/Userdata/ESP8266_RTOS_SDK_LWIP/third_party

#EXTRA_CCFLAGS += -u

then make in the sdk dir

Alexander V. Ribchansky
@avr39-ripe
Mar 18 2016 15:01
@hreintke oh, thanks fo sharing.. will look on it at the evening..
linlun
@linlun
Mar 18 2016 17:07
@slaff Tnx, works great
Curtis Pope
@piperpilot
Mar 18 2016 19:01
@teicors I'm seeing a behavior where when you connect to a wifi network, it loses its connection to the AP. Even if you re-connect to the AP, it seems that DHCP isn't enabled and it doesn't get an IP. This just spins with a spinner as the user never gets feedback that the connection was successful.
teicors
@teicors
Mar 18 2016 19:21
@piperpilot you're right. I was focused on the log and not to the (in my case) the phone. The esp connect the new ssid and he takes the new ip while the phone is spinning.
Now I can ping the esp with the address of my wifi while on my phone still remain the animation.