These are chat archives for SmingHub/Sming

15th
Feb 2016
alon24
@alon24
Feb 15 2016 06:35
@hreintke your fix works as is for setting 2 pins in hwpwm
now my issue is that I am trying to test the freq, and it does not seem to do anything
I do not know motors, but it does not seem ok to me
/*
 * pin - pin number
 * Freq in MHZ so 250 == 250 MHZ
 * pwr - how much power 0-1023
 */
void CarCommand::handleCheckFreq(int pin, int freq, int pwr) {
    int time = 1000 /freq * 1000;
    pwmMotors->setPeriod(time);
    pwmMotors->analogWrite(pin, pwr);
    debugf("handleCheckFreq pin=%i, freq=%i, time=%i, pwr=%i", pin, freq, time, pwr);
}
alon24
@alon24
Feb 15 2016 06:46
Maybe there is an issue with implementation:

/* Function Name: setPeriod
 * Description: This function is used to set Period of PWM.
 *                Period / frequency will remain same for all pins.
 */
void HardwarePWM::setPeriod(uint32 period) {
    maxduty = (period * 1000) / 45;
    pwm_set_period(period);
    pwm_start();
}

/**
  * @brief     Set PWM period, unit : us.
  *
  *            For example, for 1KHz PWM, period is 1000 us.
  *
  * @attention After set configuration, pwm_start needs to be called to take effect.
  *
  * @param     uint32 period : PWM period, unit : us.
  *
  * @return    null
  */
void pwm_set_period(uint32 period);

so what should my time value be for 250MHZ?, and should my duty still be between 0-1023?
alon24
@alon24
Feb 15 2016 06:56
@hreintke I do not see any conversion for duty in setDuty in hwpwm - should it not be a conversion table between 0-1023 -> 0-maxDuty?
hreintke
@hreintke
Feb 15 2016 09:19
@alon24 :
For Period/Frequency :
Your calculation of the period is not correct.
The int time = 1000 /freq * 1000; is the same as time = 1 / freq -> time is in units of seconds.
The time parameter in setPeriod in microseconds -> You need to multiply by 1.000.000
For maxduty :
Indeed I missed that in the PR. maxduty is now fixed to 1023 and not (as it is in NOS) dependent of the frequency.
I will change the hardwarePWM class accordingly.
alon24
@alon24
Feb 15 2016 09:47
yeah I figured all that, my car now works :)
also adding a thumb view (joystick) now :)
thanks
1000000?

/*
 * pin - pin number
 * Freq in MHZ so 250 == 250 MHZ
 * pwr - how much power 0-1023
 */
void CarCommand::handleCheckFreq(int pin, int freq, int pwr) {
        int time = freq * 1000;
    pwmMotors->setPeriod(time);
    pwmMotors->analogWrite(pin, pwr);
    pwmMotors->restart();
    debugf("handleCheckFreq pin=%i, freq=%i, time=%i, pwr=%i", pin, freq, time, pwr);
}
that seems to work
my freq now is 30MHZ
alon24
@alon24
Feb 15 2016 09:52
(did not check with the latest update)
hreintke
@hreintke
Feb 15 2016 09:55
Just pushed my updates to the branch and merged into master.
Deleted the hardwarePWM_Update brach.
Your freq-> time formula is not correct. See my previous remark.
f.e. for 250Mhz, the period should become 4000
alon24
@alon24
Feb 15 2016 10:03
This message was deleted
I am confused, will try to be more coherent and return!
hreintke
@hreintke
Feb 15 2016 10:20

Another from your code :
You are doing :

    pwmMotors->analogWrite(pin, pwr);
    pwmMotors->restart();

Beware that default behavior of analogwrite is analogWrite(pin, pwr, true); -> pwm_start() is called within analogwrite.
The additional ->restart() is not necessary.
So be precise on when to use both options.
I submitted a bugreport on the espressif bbs. Hopefully they fix this so we don't have to take care of this within applications.

alonewolfx2
@alonewolfx2
Feb 15 2016 10:54
Anyone has neopixel more than 50 pixel?
I have an issue like flickering when use more than 10 or sometimes 16 pixel.
ystrem
@ystrem
Feb 15 2016 11:08
@alonewolfx2 I have about 60pcs
alon24
@alon24
Feb 15 2016 11:38
@hreintke so if 1khz == 1000us -> 1Hz==1us -> 250Hz ==250us -----> setPeriod(250) ???? (the example is from pwm.h)
alonewolfx2
@alonewolfx2
Feb 15 2016 12:30
@ystrem can you try an example if I send you?
ystrem
@ystrem
Feb 15 2016 12:54
yep in the evening
RTOS ?
hreintke
@hreintke
Feb 15 2016 13:16
@alon24 :
At 1Khz = 1000 cycles per second then every 1000us will start a new period -> Period = 1000
At 500Hz = 500 cycles per second then every 2000us will start a new period -> Period = 2000
At 250Hz = 250 cycles per second then every 4000us will start a new period -> Period = 4000.
Period = 1/freqency. If freq = 250 period = 1/250 = 0.004 second, 0.004 seconds = 4000us -> period = 4000
alon24
@alon24
Feb 15 2016 13:38
k so I landeded on 1000000 / 40 -> 40Hz (It seems to be ok)
hreintke
@hreintke
Feb 15 2016 14:33
Don't know what you set to 1000000 but for 40Hz period should be 25000
alon24
@alon24
Feb 15 2016 14:36
yes thats ecatly right - what i did - 25000
Alexander V. Ribchansky
@avr39-ripe
Feb 15 2016 14:55
@rosiste @alonewolfx2 #603 :)
hreintke
@hreintke
Feb 15 2016 15:01
@/all :
I am experimenting with interrupts (on GPIO).
Tried the basic_interrupts but without luck.
Does anyone have a working example ?
hreintke
@hreintke
Feb 15 2016 15:52
Little too quick with asking.
However I do not understand how the interrupt handling ever worked in NONOS.
As far as I can see the GPIO interrupts were never unmasked so should never fire.
But for now : issue fixed in SmingRTOS. Working OK.
crosofg
@crosofg
Feb 15 2016 15:55
@hreintke the interrupt was working for me. I had included it in the io port expander PR.
guys I am trying to build sming on cloud 9 online IDE.
but where do I put esptool2?
# Generating image...
make: esptool2: Command not found
make: *** [out/build/app.out] Error 127
crosofg:~/Sming/samples/Basic_Blink (feature/axtls-dev) $ ESP_HOME
I can see esptool2 in esp-open-sdk/utils
alonewolfx2
@alonewolfx2
Feb 15 2016 15:58
@avr39-ripe thanks­čśâ one more question. Is it work with ds1307
@crosofg it seems your esp home directory not set
Alexander V. Ribchansky
@avr39-ripe
Feb 15 2016 15:59
@alonewolfx2 don't think so.. AFAIK this chips is incompatible.. moreover - ds1307 is far worse than ds3231.. and it is AFAIK incompatible with 3.3V.. My ds1307 module is indeed incompatible with 3.3V ;(
@alonewolfx2 ds3231 module is VERY cheap on aliexpress.. about 0.56$$ ;)))
crosofg
@crosofg
Feb 15 2016 16:10
@alonewolfx2 i have set he esp home directory
crosofg:/opt $ cd esp-open-sdk/
crosofg:/opt/esp-open-sdk $ ls
esp-alt-sdk-v1.4.0.258-linux-x86_64.tar.gz  esp_iot_sdk_v1.4.0/  sdk@  utils/  xtensa-lx106-elf/
crosofg:/opt/esp-open-sdk $ pwd
/opt/esp-open-sdk
crosofg:/opt/esp-open-sdk $ la
esp-alt-sdk-v1.4.0.258-linux-x86_64.tar.gz  esp_iot_sdk_v1.4.0/  sdk@  utils/  xtensa-lx106-elf/
crosofg:/opt/esp-open-sdk $ export ESP_HOME=/opt/esp-open-sdk
crosofg:/opt/esp-open-sdk $ cd ~
crosofg:~ $ cd Sming/samples/
S├ębastien
@sle118
Feb 15 2016 16:25
Going to repost the same question as last night as I think everyone was asleep or with their valentine
Hello All. I am trying to setup GDB in Eclipse Linux. when creating the remote debug configuration, there is no option for me to select serial as the connection
all I can see is an option for the GDB server
can anyone point me to the right direction? From what I read here, serial should be available but it's not
https://blog.attachix.com/live-debugging-with-open-source-tools-programming-for-esp8266-part-4/
hoping someone will send me the right way
crosofg
@crosofg
Feb 15 2016 16:31
where should I copy esptool2 ? I am using esp-alt-sdk
robotiko
@robotiko
Feb 15 2016 16:33
@sle118 I recall
when I tried
some tricky eclipse multitab thing
look carefully all options in the seeting screens
you will see it
crosofg
@crosofg
Feb 15 2016 16:35
hola people. Can you help me with the correct location of esptool2?
robotiko
@robotiko
Feb 15 2016 16:36
@crosofg you have to define in sming vars
so there is no "correct location"
simply tell sming where it is
S├ębastien
@sle118
Feb 15 2016 16:49
@robotiko Which setting screen? Some general settings, or when creating the debugging profile?
robotiko
@robotiko
Feb 15 2016 16:54
when creating the debugging profile
crosofg
@crosofg
Feb 15 2016 16:55
Did anybody got ssl feature working ?
upon compil;ing I am getting these errors
CC axtls-8266/compat/lwipr_compat.c
CC axtls-8266/replacements/mem.c
In file included from system/include/mem_manager.h:5:0,
                 from axtls-8266/replacements/mem.c:27:
axtls-8266/replacements/mem.c: In function 'ax_port_malloc':
/opt/esp-open-sdk/sdk/include/mem.h:6:27: error: implicit declaration of function 'pvPortMalloc' [-Werror=implicit-function-declaration]
 #define os_malloc(s)      pvPortMalloc(s, "", 0)
                           ^
axtls-8266/replacements/mem.c:30:16: note: in expansion of macro 'os_malloc'
 #define malloc os_malloc
                ^
axtls-8266/replacements/mem.c:41:28: note: in expansion of macro 'malloc'
     void* result = (void *)malloc(size);
                            ^
axtls-8266/replacements/mem.c: In function 'ax_port_calloc':
axtls-8266/replacements/mem.c:32:16: error: implicit declaration of function 'ets_memset' [-Werror=implicit-function-declaration]
 #define memset ets_memset
                ^
axtls-8266/replacements/mem.c:55:5: note: in expansion of macro 'memset'
     memset(result, 0, size * count);
     ^
In file included from system/include/mem_manager.h:5:0,
                 from axtls-8266/replacements/mem.c:27:
axtls-8266/replacements/mem.c: In function 'ax_port_realloc':
/opt/esp-open-sdk/sdk/include/mem.h:8:27: error: implicit declaration of function 'pvPortRealloc' [-Werror=implicit-function-declaration]
 #define os_realloc(p, s)  pvPortRealloc(p, s, "", 0)
                           ^
axtls-8266/replacements/mem.c:31:17: note: in expansion of macro 'os_realloc'
 #define realloc os_realloc
                 ^
axtls-8266/replacements/mem.c:60:28: note: in expansion of macro 'realloc'
     void* result = (void* )realloc(ptr, size);
                            ^
axtls-8266/replacements/mem.c: In function 'ax_port_free':
/opt/esp-open-sdk/sdk/include/mem.h:5:27: error: implicit declaration of function 'vPortFree' [-Werror=implicit-function-declaration]
 #define os_free(s)        vPortFree(s, "", 0)
                           ^
axtls-8266/replacements/mem.c:29:14: note: in expansion of macro 'os_free'
 #define free os_free
              ^
axtls-8266/replacements/mem.c:71:5: note: in expansion of macro 'free'
     free(ptr);
     ^
cc1: all warnings being treated as errors
make: *** [out/build/axtls-8266/replacements/mem.o] Error 1
robotiko
@robotiko
Feb 15 2016 16:56
@crosofg windows? cherts?
doesnt work with those
crosofg
@crosofg
Feb 15 2016 16:57
esp-alt-sdk
on cloud 9 online ide
robotiko
@robotiko
Feb 15 2016 16:58
then open the issue
it was supposed to work under linux with esp-alt-sdk
crosofg
@crosofg
Feb 15 2016 17:00
maybe I have some settings wrong
HappyCodingRobot
@HappyCodingRobot
Feb 15 2016 17:40
@alonewolfx2 re:neopixel, for longer lines try APA102 LEDs, they are much easier and faster ;) i'm also building a little class at the moment
S├ębastien
@sle118
Feb 15 2016 17:50
@robotiko for the record, I had to change the launcher to "Using GDB (DSF) Manual Remote Debugging Launcher". This then opens up the connection type
robotiko
@robotiko
Feb 15 2016 17:51
@sle118 that gives you the option?
I recall I had same issue.. and it was just a matter of playing around the eclipse screens
alonewolfx2
@alonewolfx2
Feb 15 2016 18:04
@HappyCodingRobot where can i buy and what is price?
S├ębastien
@sle118
Feb 15 2016 18:04
@robotiko yes, it opened up the connection option
now I think there probably is another option to setup
hreintke
@hreintke
Feb 15 2016 18:08
@crosofg :
You can get esptool2 from repo : https://github.com/raburton/esptool2
Not sure whether it included in alt-sdk. For sure not in open-sdk and UDK
BTW : found the reason/difference on interrupt handling between NONOS and RTOS.
And indeed both work.
robotiko
@robotiko
Feb 15 2016 18:34
@hreintke and the difefrence?
or difference :D
S├ębastien
@sle118
Feb 15 2016 19:56
@robotiko , or anyone, I have setup my environment for GDB , compiled everything good. When attaching to GDB, I am getting a wierd result

0x67d72040 in ?? ()

robotiko
@robotiko
Feb 15 2016 19:57
@sle118 lucky you that can even compile gdb code
:S
S├ębastien
@sle118
Feb 15 2016 19:57
instead of the actual function name
robotiko
@robotiko
Feb 15 2016 19:57
:D
S├ębastien
@sle118
Feb 15 2016 19:57
I guess: linux
looks as though gdb is not finding symbols
Then I am getting a bunch of these

Register 42 is not available

Ignoring packet error, continuing...

robotiko
@robotiko
Feb 15 2016 19:58
great
S├ębastien
@sle118
Feb 15 2016 19:58
not so ;)
robotiko
@robotiko
Feb 15 2016 19:58
if Mr google cannot help you
I would open an issue in thr PR
or reach @slaff here
sorry
to not be more helpful there
S├ębastien
@sle118
Feb 15 2016 20:01
I'll try to ping Slaff
not sure if still active
robotiko
@robotiko
Feb 15 2016 20:03
usually .. but high latency :D
alonewolfx2
@alonewolfx2
Feb 15 2016 20:10
@avr39-ripe is your ds3231 library manage eeprom on ds3231 module?
Andri
@andriyadi
Feb 15 2016 20:29
Hi @alonewolfx2 thanks for responding my posted issues here: SmingHub/Sming#572
I've posted my response.
hreintke
@hreintke
Feb 15 2016 20:43
@andriyadi : So did I :smile:
S├ębastien
@sle118
Feb 15 2016 20:48
@slaff I have added a comment to SmingHub/Sming#350
I'd appreciate some help if you have a minute.
Andri
@andriyadi
Feb 15 2016 20:56
@hreintke :)
Alexander V. Ribchansky
@avr39-ripe
Feb 15 2016 22:34
@alonewolfx2 no, this eeprom should be handled separately.. And I'm just port library, not write it.