These are chat archives for SmingHub/Sming

9th
Nov 2015
Murli Shenoy
@hmms
Nov 09 2015 06:53
i was working on issue #399 . i tried using the logic analyzer to check what if there was an issue with the I2C
the following screen grab shows the "read temperate" command(0x40, the chip I2C ID followed by 0xE3) being sent out. the adafruit library works fine with the arduino uno, but when i try it with Sming it fails to read data from the HTU21DF sensor. could it be something with the SCL line?
blob
Murli Shenoy
@hmms
Nov 09 2015 07:20
please ignore the previous screen grab here's the corrected one.
blob
hreintke
@hreintke
Nov 09 2015 07:30
@raburton :
Would it be (technically) possible to "flash the bootinfo"
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 08:35
@raburton can you share your timezone/dst code please?
@hmms did you try to use your i2c device on esp8266 + esp8266/Arduino ? May be your dev is incompatible (by pullup resistors AFAIK) with 3.3V?
Richard Antony Burton
@raburton
Nov 09 2015 09:14
@hreintke what do you mean flash the boot info?
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 09:22
@raburton Oh, thanks a lot for fast answer! will peek on it soon :)
open-home-automation
@open-home-automation
Nov 09 2015 09:39
@raburton I was looking at having a generic solution which could support all timezones. I am now looking at it in a different way. Using the webserver I could provide a dropdown statically containing most timezones, with their offset to utc and maybe the start and end date of dst. When user picks a timezone I could fetch all data from the post message. As the system clock class already handles offsets to UTC the only thing to do would be to check the time in my main timer task and apply/unapply DST as applicable, using your code example most certainly. To save space/cpu on the ESP I could even fetch the data to populate the select box from a real server and let jquery do the work. I will only have to collect all this data from somewhere...
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 09:47
@open-home-automation http://www.twinsun.com/tz/tz-link.htm or google something like "zoneinfo" | "tzdata"
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 15:18
Can somebody tell me if I can use Smings Timers for LOOONG duration.. about hour or two hour? Will it reliable work? Or I'd better run shorter timer and implement some kind of counter?
Dmitry Kireev
@kireevco
Nov 09 2015 15:21
@avr39-ripe I could be wrong, but any blocking procedure is not ideal for sming
it’s meant to be async
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 15:22
@kireevco I want to be async.. so no delay, but Temer.initializeMs(looong_duration.... );
so question is how long can be this long duration?
Dmitry Kireev
@kireevco
Nov 09 2015 15:22
hehe, very good question. What stops you from testing?
(I’m behind on hardware for some time, focused on some less-obvious things
like environment and deployments
and I’m away from home for about 3 months now :-D
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 15:24
Russian word LEN ;) I'll try to find it analyzing sources, not simply chek max duration :)
Dmitry Kireev
@kireevco
Nov 09 2015 15:24
lol, I know this word...
even more, right now I’m in Moscow.
and it has the most expensive starbucks in the world
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 15:25
@kireevco I know that you know.. Its funny that to russians speak in english.. isnt it? :)
Dmitry Kireev
@kireevco
Nov 09 2015 15:25
yeah,very funny.
well, in pm we speak russian, so welcome
:)
any extra complicatid questions - always welcome.
@alonewolfx2 I know you know something that we don’t know
hreintke
@hreintke
Nov 09 2015 15:45
This message was deleted
@raburton :
I mean this bootinfo :
typedef struct {
    uint8 magic;           // our magic
    uint8 version;           // config struct version
    uint8 mode;               // boot loader mode
    uint8 current_rom;       // currently selected rom
    uint8 gpio_rom;           // rom to use for gpio boot
    uint8 count;           // number of roms in use
    uint8 unused[2];       // padding
    uint32 roms[MAX_ROMS]; // flash addresses of the roms
#ifdef BOOT_CONFIG_CHKSUM
    uint8 chksum;           // config chksum
#endif
} rboot_config;
Tomáš Procházka
@tprochazka
Nov 09 2015 15:52

Does anybody tried this library on Sming?
https://github.com/adafruit/Adafruit_NeoPixel
It has ESP8266 support and it works well in Arduino IDE
But when I tried to compile it in Sming I got just

out/build/app_app.a(Adafruit_NeoPixel.o): In function `Adafruit_NeoPixel::updateType(unsigned char)':
...SmingExperiment/app/Adafruit_NeoPixel.cpp:1065: undefined reference to `espShow'
out/build/app_app.a(Adafruit_NeoPixel.o): In function `Adafruit_NeoPixel::show()':
...SmingExperiment/app/Adafruit_NeoPixel.cpp:1065: undefined reference to `espShow'
collect2.exe: error: ld returned 1 exit status
make: *** [out/build/app.out] Error 1

There is some special contrsuct

#ifdef ESP8266
// ESP8266 show() is external to enforce ICACHE_RAM_ATTR execution
extern "C" void ICACHE_RAM_ATTR espShow(
  uint8_t pin, uint8_t *pixels, uint32_t numBytes, uint8_t type);
#endif // ESP8266

and separate file esp8266.c
But I don't understand how exactly it should work, how compiler recognize to include esp8266.c

Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 16:02
@tprochazka I think you should put esp8266.c in same dir as main library files if you try to integrate this lib into Sming/Libraries
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 16:12
just put FULL clone of https://github.com/adafruit/Adafruit_NeoPixel in to Sming/Libraries and it will compile just fine! Do not have hardware to test it..
robotiko
@robotiko
Nov 09 2015 16:28
Hi, do anyone has a working example on how to activate two pins simultaneously?
I have seen several Issues and PR about this .. and I wonder if it works or not really
zhivko
@zhivko
Nov 09 2015 16:30
that feature would be really nice.
robotiko
@robotiko
Nov 09 2015 16:52
@tprochazka do you recent pr about gpio fixes is related to this, right?
robotiko
@robotiko
Nov 09 2015 17:08
@zhivko gpio_output_set should do it.
no sure if it is available in sming
alonewolfx2
@alonewolfx2
Nov 09 2015 18:16
@alonewolfx2 I know you know something that we don’t know
@kireevco about what :)
Alexander V. Ribchansky
@avr39-ripe
Nov 09 2015 18:47
@alonewolfx2 @robotiko about long period sming timers.. how long can they be? Can I arm timer for about one or two hours?
robotiko
@robotiko
Nov 09 2015 18:48
@avr39-ripe never tried.. seems yes but there was an issue about reset when reaching a max timer of ... I recall 71mins
look in issues. I think it was closed
and is something that happened in esp arduino and sming
linlun
@linlun
Nov 09 2015 18:49
there is an issue regarding the millis()-function, it wrapps at 71 minutes
don't know if that has anything to do with the timer functions
linlun
@linlun
Nov 09 2015 19:31
I have seen a couple of issues (#387 and #393 ) regarding how to set up the link-files and the SPI-SIZE, I also created a forum post on this a couple of day ago (http://www.esp8266.com/viewtopic.php?f=35&t=6406#p33176) , can anyone guide me on how to set this up for different flash sizes or maybe someone have a link to a website with more information?
alonewolfx2
@alonewolfx2
Nov 09 2015 19:35
@robotiko is right
Murli Shenoy
@hmms
Nov 09 2015 20:19
@avr39-ripe I will give that a try with esp8266/Arduino today, also I do have 4.7K pullups on SDA and SCL.
zhivko
@zhivko
Nov 09 2015 22:24
@robotiko that will allow me to move all steppers at the same time :) this is exactly what I need!
robotiko
@robotiko
Nov 09 2015 22:24
yup
:D
tested?
Tomáš Procházka
@tprochazka
Nov 09 2015 22:34

@avr39-ripe

just put FULL clone of https://github.com/adafruit/Adafruit_NeoPixel in to Sming/Libraries and it will compile just fine! Do not have hardware to test it..

Sorry for delay, I was out. I put all .c a and .h directly to my app folder in my project, I think that it should be the same as Sming/Libraries or not?

@robotiko My PR was about problem SmingHub/Sming#397.
robotiko
@robotiko
Nov 09 2015 22:37
@tprochazka thanks.. not same thing
zhivko
@zhivko
Nov 09 2015 22:42
Anybody has sample how to use wsBinaryReceived? I am looking for a way to write it to second flash partition.
Should I just use: memcpy() ?
Tomáš Procházka
@tprochazka
Nov 09 2015 22:55
@avr39-ripe so yes, Adafruit_NeoPixel in the Sming/Libraries produce the same error like if I have it in my project directly
Tomáš Procházka
@tprochazka
Nov 09 2015 23:14
@avr39-ripe esp8266.c must be included somehow for the compiler
Tomáš Procházka
@tprochazka
Nov 09 2015 23:32

@avr39-ripe I found the reason. esp8266.c was compiled, but separated, so ESP8266 was not declared. So I removed #ifdef ESP8266, but it still fail because of Arduino.h in the Sming include also .cpp code, not just .c like Arduino. And it is not possible use .cpp from .c code, so I replace #include in the esp8266.c file to this

#define F_CPU 80000000L

#include <stdint.h>
#include <espinc/c_types_compatible.h>
#include <WConstants.h>
#include <BitManipulations.h>

Just what was needed.
Maybe it is not best solution, but it works!

It is very sad, that Sming is so much incompatible with the Aduino :-(

Tomáš Procházka
@tprochazka
Nov 09 2015 23:51
So no, it is possible to compile but it doesn't work