logo elektroda
logo elektroda
X
logo elektroda

[BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

p.kaczmarek2 177399 1242
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #331 19925295
    p.kaczmarek2
    Moderator Smart Home
    ExploWare wrote:
    I seem to loose WiFi connectivity over time on several modules.
    Anyone else recognizes this?

    How long after the restart, and what does the log say?

    @absinth84 , good job


    pillarama wrote:

    I went searching and found the Belkencorp Github. There seems to be a lot of useful stuff on there including what looks like I2C drivers for several chips there. Could these be useful?
    https://github.com/bekencorp?tab=repositories
    https://github.com/bekencorp/bk7231_rtt_sdk/blob/master/drivers/drv_iic.c
    https://github.com/bekencorp/bk7231u_rtt_sdk/blob/master/drivers/drv_iic.c

    I've also seen something leading to full Tuya I2C implementation but we seem to have only headers:
    Code: C / C++
    Log in, to see the code

    So maybe your option is better.... rt_i2c_bit_add_bus? A part of RTos?
    Ah, the backend of this driver is here:
    https://github.com/bekencorp/bk7231u_rtt_sdk/...7a87a920b918/rt-thread/components/drivers/i2c
    We would have to port it....
    but I just realized. Maybe there is indeed an I2C driver in the very beken SDK we are using?
    https://github.com/tuya/tuya-iotos-embeded-sd...1t_os/beken378/func/user_driver/BkDriverI2c.h

    Code: C / C++
    Log in, to see the code

    Quote:

    bk_i2c_t port; /**< Platform I2C port that is connected to the target I2C device, - e.g. BK_I2C_1 */


    EDIT: it seems to be missing some types:
    
    In file included from ../../../apps/OpenBK7231T_App/src/new_pins.c:61:0:
    ./beken378/common/../../beken378/func/user_driver/BkDriverI2c.h:70:9: error: unknown type name 'platform_i2c_bus_address_width_t'
     typedef platform_i2c_bus_address_width_t        bk_i2c_bus_address_width_t;
             ^
    ./beken378/common/../../beken378/func/user_driver/BkDriverI2c.h:72:9: error: unknown type name 'platform_i2c_speed_mode_t'
     typedef platform_i2c_speed_mode_t               bk_i2c_speed_mode_t;
             ^
    ./beken378/common/../../beken378/func/user_driver/BkDriverI2c.h:74:9: error: unknown type name 'platform_i2c_message_t'
     typedef platform_i2c_message_t                  bk_i2c_message_t;
             ^
    ./beken378/common/../../beken378/func/user_driver/BkDriverI2c.h:78:5: error: unknown type name 'bk_i2c_t'
         bk_i2c_t                    port;           /**< Platform I2C port that is connected to the target I2C device, - e.g. BK_I2C_1 */
    

    Especially bk_i2c_t type, I will look for them


    I've also found more low llevel api:
    Code: C / C++
    Log in, to see the code



    pillarama wrote:

    BK7231 Pin layout:
    PWM4 I2C CLK
    PWM5 I2C DATA (Incorrectly labelled as PWM2 on the bottom of PCB)

    How do you know it's labelled incorrectly?

    EDIT:
    
    W:\GIT\OpenBK7231T\platforms\bk7231t\bk7231t_os/../../../apps/OpenBK7231T_App/src/new_pins.c:115: undefined reference to `i2c1_open'
    W:\GIT\OpenBK7231T\platforms\bk7231t\bk7231t_os/../../../apps/OpenBK7231T_App/src/new_pins.c:120: undefined reference to `i2c1_write'
    W:\GIT\OpenBK7231T\platforms\bk7231t\bk7231t_os/../../../apps/OpenBK7231T_App/src/new_pins.c:127: undefined reference to `i2c1_read'
    W:\GIT\OpenBK7231T\platforms\bk7231t\bk7231t_os/../../../apps/OpenBK7231T_App/src/new_pins.c:130: undefined reference to `i2c1_close'
    collect2.exe: error: ld returned 1 exit status
    make[2]: *** [application.mk:640: application] Błąd 1
    make[2]: Opuszczenie katalogu '/cygdrive/w/GIT/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    make[1]: *** [Makefile:5: mp] Błąd 2
    make[1]: Opuszczenie katalogu '/cygdrive/w/GIT/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    make: *** [Makefile:6: all] Błąd 2
    

    So it's time to update makefile, I hope all references are available in SDK

    EDIT: datasheet of some bk7231 module with information which pin is hardware I2C:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #332 19925800
    ExploWare
    Level 10  
    p.kaczmarek2 wrote:
    ExploWare wrote:
    I seem to loose WiFi connectivity over time on several modules.
    Anyone else recognizes this?

    How long after the restart, and what does the log say?

    Days, sometimes more then a week. I only notice it when HomeAssistant starts to say Unavailable at the Toggle switch.
    I started the log in my servers browser at the webapp, and for that I cloned the webapp and removed the truncate option.
    is there maybe a more useful way to keep pulling the logs for over a week?
    Maybe I'll find a way to pull in from bash into a file... I'll get on that tonight
  • #333 19926050
    p.kaczmarek2
    Moderator Smart Home
    After half a day, we have a working hardware I2C demo!
    Here is my setup:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    This is a TC74A2, an example I2C device (simple temperature sensor) which I had at had, used only for testing.
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Code snippet:
    Code: C / C++
    Log in, to see the code

    The hardware I2C 1 module is accessed via DD interface. The "camera_intf_sccb_write" functions are not really needed, it's just that I've been basing of the camera sample from the SDK, code will be simplified.
    The I2C device address for A2 version was taken from datasheet:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Results:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    NOTE: this is just an example, the whole per-device I2C support is still TODO, including the configuration and frontend systems.

    Do anyone know which I2C devices would be useful to implement?

    NOTE2: Hardware I2C 1 is bound to pins P20 (I2C1_SCL, TCK, SCL) and P21 (I2C1_SDA, TMS, CS)

    ExploWare wrote:

    Days, sometimes more then a week. I only notice it when HomeAssistant starts to say Unavailable at the Toggle switch.

    Hmm, does the device just starts to hang after that time and it's not responsive even to physical button touch, or is the only WiFi connection lost?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #334 19926120
    ExploWare
    Level 10  
    p.kaczmarek2 wrote:

    Hmm, does the device just starts to hang after that time and it's not responsive even to physical button touch, or is the only WiFi connection lost?

    It is responsive to the physical button, just not on the mqtt and webserver. It is still listed at my androids Port-Authority app when I scan for devicez, but the portscan doesn't show any open ports.
  • #335 19926169
    p.kaczmarek2
    Moderator Smart Home
    Well, is it still visible on router DHCP clients list? Is the DHCP lease still renewed in that case? (for me, router renews DHCP IP lease about every 2 hours).
    Helpful post? Buy me a coffee.
  • #336 19928890
    pepesuriano
    Level 9  
    ExploWare wrote:

    I fail to see a question. I thought it was reporting a success story.

    Can you rephrase your question?


    p.kaczmarek2 wrote:

    So it's working or is it not?


    Apologies, must be some difference in our native languages of handling questions and it's translation to english :P

    In my previous posts, when I said "no luck" it was meaning that I tried that and it didn't worked. I got the same behaviour the relay clicks, but bkwriter don't detect anything and python neither.

    Do you have a device to test if you plug RX1 and open the serial console, do you see anything there? I think it must show up somethin (I know this is just for programming, but in my case I don't see anything). Also, the question of R3 from my previous post is to see if that there is something electrically blocking RX1/TX1
  • #337 19928942
    p.kaczmarek2
    Moderator Smart Home
    Ok let's see (power off state):
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    after power on:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    After 4 power off and power on cycles:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    So it seems to be receiving something, but you would have to look into uart python flasher source to see if it's really something or just a noise...



    Btw, I have a progress with TuyaMCU:
    Screenshot of a log console displaying error and connection information.
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    A fragment of a log with debugging messages and TuyaMCU state information.
    230 and 24.... or, rather, 23.0 and 24:
    Digital clock display showing temperature 23.3°C, humidity 24%, day of the week WEDNESDAY, time 8:08 AM, and date July 15, 2012.
    The temperature has changed by 0.3 degrees before I took the photo, but you can clearly see that we can receive device state data from TuyaMCU right now!
    Helpful post? Buy me a coffee.
  • #338 19928962
    ExploWare
    Level 10  
    p.kaczmarek2 wrote:
    Ok let's see (power off state):
    [url=https://obrazki.elektroda.pl/1253291800_1647181419.png][img]

    Just to be sure, left is 1RX/1TX and right is 2RX/2TX, correct?
    And it shows 1RX is as good as silent, that is my experience also. It is treating the 2RX/2TX pair as the real log/debug connection.
    Makes sense since the 1RX/1TX can be connected to peripherals and if that device would receive the debug garbage it would mess that up. (Imagine an LED connected to the TX1, it would just randomly blink for the user)

    You will only know whether the 1RX/1TX pair is connected correctly, if you can initiate a read connection, for example with the bkwriter tool.

    Dodano po 2 [minuty]:

    p.kaczmarek2 wrote:

    Btw, I have a progress with TuyaMCU:

    Thats great news!
  • ADVERTISEMENT
  • #339 19930002
    pepesuriano
    Level 9  
    Ok I will share what I see with bkwriter and python:

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    (Tested 115200 and 1500000 also in bkwriter)

    python:
    python3 uartprogram -d /dev/ttyUSB0 -r dump.bin
    UartDownloader....
    Read Getting Bus...
    Cannot get bus.
    Traceback (most recent call last):
    File "/tmp/hid_download_py/uartprogram", line 56, in <module>
    downloader.read(args.filename, args.startaddr, args.length)
    File "/tmp/hid_download_py/bkutils/uart_downloader.py", line 83, in read
    self.pbar.close()
    AttributeError: 'NoneType' object has no attribute 'close'

    On both cases, I started reading flash, and then cut power/plug again and also tried with CEN to GND reset. I never get a measure...

    For the moment the plug is fine, I can manage it in tuya app so it's not fried.
  • #340 19932845
    btsimonh
    Level 11  
    Another successful conversion.

    Avatar ASL04 5v LED strip (TV backlight).
    It comes with a multi-segment RGB strip, about £12 from Amazon delivered in the UK.
    avatar.bin is the flash dump (0x11000 onwards).
    bootlog.txt the original boot log.
    Beken based WB8 module (not documented by Tuya, but similar toWB3L in form factor).

    The unit I received has an issue with the power lead (does not always make a good connection), but apart from that, build quality is good.

    pins:
    P24 -> PWM (red)
    P6 -> PWM (green)
    P8 -> PWM (blue)

    P7 -> btn - music
    P9 -> btn - colour
    P14 -> btn - on/off

    P16 -> IR?

    Images:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    With latest OBK firmware, it performs well for command color #rrggbb
    Buttons can be configured as individual control of red, green, blue....

    The unit has a microphone on it for 'sound to light' - yet to implement or determine pin, but the beken SDK comes with an audio driver, and also with an FFT driver (and hardware?), so let's see....

    br, btsimonh :).
  • ADVERTISEMENT
  • #341 19934013
    pepesuriano
    Level 9  
    pepesuriano wrote:
    Ok I will share what I see with bkwriter and python:

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    (Tested 115200 and 1500000 also in bkwriter)

    python:
    python3 uartprogram -d /dev/ttyUSB0 -r dump.bin
    UartDownloader....
    Read Getting Bus...
    Cannot get bus.
    Traceback (most recent call last):
    File "/tmp/hid_download_py/uartprogram", line 56, in <module>
    downloader.read(args.filename, args.startaddr, args.length)
    File "/tmp/hid_download_py/bkutils/uart_downloader.py", line 83, in read
    self.pbar.close()
    AttributeError: 'NoneType' object has no attribute 'close'

    On both cases, I started reading flash, and then cut power/plug again and also tried with CEN to GND reset. I never get a measure...

    For the moment the plug is fine, I can manage it in tuya app so it's not fried.


    Any suggestions on why I have these messages in BK writer and Python? It's still not working to read or program
  • #342 19934198
    btsimonh
    Level 11  
    Hi pepesuriano,

    1/ pls confirm you have seen debug logs on the other port.
    2/ re-check your connections - GND, TX & RX.
    3/ try reversing TX & RX.
    4/ sometimes it takes me two or three power-restarts to get a read (sometimes having to restart python in between if it has already timed out).
    The error from uartprogram is just it trying to close the non-existent progress bar (me being lazy, PRs welcome). The failure is that the programmer is not getting a response.
    Basically, it continually sends bytes at startup for 5(?) seconds, and only if it gets a response, then changes the baud rate from 115200 to the selected rate by sending a command to the device. So your failure is at the start phase, not after baud rate change. i.e. as long as it has the same bootloader (not guaranteed, but probable?), then your issue is one of basic serial communication or an electrical problem (incorrect GND, RX/TX line short to ground/somewhere, etc?).

    let us know how you get on,
    br, Simon
  • #343 19934818
    ExploWare
    Level 10  
    p.kaczmarek2 wrote:
    ExploWare wrote:
    I seem to loose WiFi connectivity over time on several modules.
    Anyone else recognizes this?

    How long after the restart, and what does the log say?


    It is offline since 2 AM, as the last logs show. It is NOT UPDATED in the DHCP table, its also not available in the Port Authority listing, so must have been mistaking before.
    No direct error reporting in the log:
    Spoiler:

    
    Log started:
    [Fri, 11 Mar 2022 19:17:22 GMT] Info:MAIN:Timer is 83601 free mem 108984
    Info:MAIN:Timer is 83602 free mem 109192
    ...
    ...
    ...
    [Wed, 16 Mar 2022 02:27:07 GMT] Info:MAIN:Timer is 454968 free mem 109224
    Info:MAIN:Timer is 454969 free mem 109224
    Info:MAIN:Timer is 454970 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 454971 free mem 109224
    Info:MAIN:Timer is 454972 free mem 109224
    Info:MAIN:Timer is 454973 free mem 109224
    Info:MAIN:Timer is 454974 free mem 109224
    Info:MAIN:Timer is 454975 free mem 109224
    Info:MAIN:Timer is 454976 free mem 109224
    Info:MAIN:Timer is 454977 free mem 109224
    Info:MAIN:Timer is 454978 free mem 109224
    Info:MAIN:Timer is 454979 free mem 109224
    Info:MAIN:Timer is 454980 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 454981 free mem 109224
    Info:MAIN:Timer is 454982 free mem 109224
    Info:MAIN:Timer is 454983 free mem 109224
    Debug:HTTP:TCP Client 192.168.2.50:21726 connected, fd: 2
    [Wed, 16 Mar 2022 02:27:23 GMT] Info:MAIN:Timer is 454984 free mem 109224
    Info:MAIN:Timer is 454985 free mem 109224
    Info:MAIN:Timer is 454986 free mem 109224
    Info:MAIN:Timer is 454987 free mem 109224
    Info:MAIN:Timer is 454988 free mem 109224
    Info:MAIN:Timer is 454989 free mem 109224
    Info:MAIN:Timer is 454990 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 454991 free mem 109224
    Info:MAIN:Timer is 454992 free mem 109224
    Info:MAIN:Timer is 454993 free mem 109224
    Info:MAIN:Timer is 454994 free mem 109224
    Info:MAIN:Timer is 454995 free mem 109224
    Info:MAIN:Timer is 454996 free mem 109224
    Info:MAIN:Timer is 454997 free mem 109224
    Info:MAIN:Timer is 454998 free mem 109224
    Info:MAIN:Timer is 454999 free mem 109224
    Debug:HTTP:TCP Client 192.168.2.50:28894 connected, fd: 2
    [Wed, 16 Mar 2022 02:27:39 GMT] Info:MAIN:Timer is 455000 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 455001 free mem 109224
    Info:MAIN:Timer is 455002 free mem 109224
    Info:MAIN:Timer is 455003 free mem 109224
    Info:MAIN:Timer is 455004 free mem 109224
    Info:MAIN:Timer is 455005 free mem 109224
    Info:MAIN:Timer is 455006 free mem 109224
    Info:MAIN:Timer is 455007 free mem 109224
    Info:MAIN:Timer is 455008 free mem 109224
    Info:MAIN:Timer is 455009 free mem 109224
    Info:MAIN:Timer is 455010 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 455011 free mem 109224
    Info:MAIN:Timer is 455012 free mem 109224
    Info:MAIN:Timer is 455013 free mem 109224
    Info:MAIN:Timer is 455014 free mem 109224
    Debug:HTTP:TCP Client 192.168.2.50:38110 connected, fd: 2
    [Wed, 16 Mar 2022 02:27:55 GMT] Info:MAIN:Timer is 455015 free mem 95536
    Info:MAIN:Timer is 455016 free mem 109224
    Info:MAIN:Timer is 455017 free mem 109224
    Info:MAIN:Timer is 455018 free mem 109224
    Info:MAIN:Timer is 455019 free mem 109224
    Info:MAIN:Timer is 455020 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 455021 free mem 109224
    Info:MAIN:Timer is 455022 free mem 109224
    Info:MAIN:Timer is 455023 free mem 109224
    Info:MAIN:Timer is 455024 free mem 109224
    Info:MAIN:Timer is 455025 free mem 109224
    Info:MAIN:Timer is 455026 free mem 109224
    Info:MAIN:Timer is 455027 free mem 109224
    Info:MAIN:Timer is 455028 free mem 109224
    Info:MAIN:Timer is 455029 free mem 109224
    Info:MAIN:Timer is 455030 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Debug:HTTP:TCP Client 192.168.2.50:50398 connected, fd: 2
    [Wed, 16 Mar 2022 02:28:10 GMT] Info:MAIN:Timer is 455031 free mem 109224
    Info:MAIN:Timer is 455032 free mem 109224
    Info:MAIN:Timer is 455033 free mem 109224
    Info:MAIN:Timer is 455034 free mem 109224
    Info:MAIN:Timer is 455035 free mem 109224
    Info:MAIN:Timer is 455036 free mem 109224
    Info:MAIN:Timer is 455037 free mem 109224
    Info:MAIN:Timer is 455038 free mem 109224
    Info:MAIN:Timer is 455039 free mem 109224
    Info:MAIN:Timer is 455040 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 455041 free mem 109224
    Info:MAIN:Timer is 455042 free mem 109224
    Info:MAIN:Timer is 455043 free mem 109224
    Info:MAIN:Timer is 455044 free mem 109224
    Info:MAIN:Timer is 455045 free mem 109224
    Info:MAIN:Timer is 455046 free mem 109224
    Debug:HTTP:TCP Client 192.168.2.50:58078 connected, fd: 2
    [Wed, 16 Mar 2022 02:28:26 GMT] Info:MAIN:Timer is 455047 free mem 109224
    Info:MAIN:Timer is 455048 free mem 109224
    Info:MAIN:Timer is 455049 free mem 109224
    Info:MAIN:Timer is 455050 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 455051 free mem 109224
    Info:MAIN:Timer is 455052 free mem 109224
    Info:MAIN:Timer is 455053 free mem 109224
    Info:MAIN:Timer is 455054 free mem 109224
    Info:MAIN:Timer is 455055 free mem 109224
    Info:MAIN:Timer is 455056 free mem 109224
    Info:MAIN:Timer is 455057 free mem 109224
    Info:MAIN:Timer is 455058 free mem 109224
    Info:MAIN:Timer is 455059 free mem 109224
    Info:MAIN:Timer is 455060 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 455061 free mem 109224
    Info:MAIN:Timer is 455062 free mem 109224
    Debug:HTTP:TCP Client 192.168.2.50:63198 connected, fd: 2
    [Wed, 16 Mar 2022 02:28:42 GMT] Info:MAIN:Timer is 455063 free mem 109224
    Info:MAIN:Timer is 455064 free mem 109224
    Info:MAIN:Timer is 455065 free mem 109224
    Info:MAIN:Timer is 455066 free mem 109224
    Info:MAIN:Timer is 455067 free mem 109224
    Info:MAIN:Timer is 455068 free mem 109224
    Info:MAIN:Timer is 455069 free mem 109224
    Info:MAIN:Timer is 455070 free mem 109224
    dhcp=0 ip=192.168.2.10 gate=192.168.2.254 mask=255.255.255.0 mac=fc:f5:c4:ca:3a:03 
    Info:MAIN:Timer is 455071 free mem 109224
    Info:MAIN:Timer is 455072 free mem 109224
    Info:MAIN:Timer is 455073 free mem 109224
    Info:MAIN:Timer is 455074 free mem 109224
    Info:MAIN:Timer is 455075 free mem 109224
    Info:MAIN:Timer is 455076 free mem 109224
    Info:MAIN:Timer is 455077 free mem 109224
    Info:MAIN:Timer is 455078 free mem 109224
    Debug:HTTP:TCP Client 192.168.2.50:5855 connected, fd: 2
    
  • #344 19934898
    pepesuriano
    Level 9  
    btsimonh wrote:
    Hi pepesuriano,

    1/ pls confirm you have seen debug logs on the other port.
    2/ re-check your connections - GND, TX & RX.
    3/ try reversing TX & RX.
    4/ sometimes it takes me two or three power-restarts to get a read (sometimes having to restart python in between if it has already timed out).
    The error from uartprogram is just it trying to close the non-existent progress bar (me being lazy, PRs welcome). The failure is that the programmer is not getting a response.
    Basically, it continually sends bytes at startup for 5(?) seconds, and only if it gets a response, then changes the baud rate from 115200 to the selected rate by sending a command to the device. So your failure is at the start phase, not after baud rate change. i.e. as long as it has the same bootloader (not guaranteed, but probable?), then your issue is one of basic serial communication or an electrical problem (incorrect GND, RX/TX line short to ground/somewhere, etc?).

    let us know how you get on,
    br, Simon


    I will answer point by point:
    1- Yes, I confirm I can see debug logs on RX2/TX2
    2- Done, GND is ok and RX1 goes to TX of UART adapter and TX1 goes to RX of UART adapter
    3- Already checked, and I also tried different UART adapters
    4- Yes I read about that, but I tried almost 10 times (each time before posting here was 10 tries, and there are multiple posts :P) and it always shows as my previous pictures
    5- Tested with multimeter and RX1/TX1 are not shorted to ground

    Also, when I put CEN to GND I see some symbols on RX1/TX1 serial console, but it is not possible to read flash anyway... and I can see how it reboots on logs of debug port (RX2/TX2) but still bk writer says "Init... FAILED" or "AttributeError: 'NoneType' object has no attribute 'close'
    " on python

    P.D.: one more test, I had put a multimeter and I have 3.2x volts between TX1 and GND
  • #345 19934959
    btsimonh
    Level 11  
    pepesuriano wrote:
    debug logs on RX2/TX2

    How close are these logs (at least in the first few lines) to the log I posted from another device above?
    pls. post the first 20 lines of the log....
    (I'm not saying it will help! but if it is a different bootloader, then maybe it will show something.....)
    Which Beken chip is it? (n or t/s)?
    If you can't get serial to go, then there is the option of SPI... it's much more complicated and you do need a raspberry pi, access to the 4 SPI pins on the wifi module, etc :(.
    Else we have a few more weeks for the wifi OTA hack to come through - just make sure it does not receive a firmware update from Tuya (unlikely).
    :( simon
  • #346 19935590
    absinth84
    Level 5  
    pepesuriano wrote:
    btsimonh wrote:
    Hi pepesuriano,

    1/ pls confirm you have seen debug logs on the other port.
    2/ re-check your connections - GND, TX & RX.
    3/ try reversing TX & RX.
    4/ sometimes it takes me two or three power-restarts to get a read (sometimes having to restart python in between if it has already timed out).
    The error from uartprogram is just it trying to close the non-existent progress bar (me being lazy, PRs welcome). The failure is that the programmer is not getting a response.
    Basically, it continually sends bytes at startup for 5(?) seconds, and only if it gets a response, then changes the baud rate from 115200 to the selected rate by sending a command to the device. So your failure is at the start phase, not after baud rate change. i.e. as long as it has the same bootloader (not guaranteed, but probable?), then your issue is one of basic serial communication or an electrical problem (incorrect GND, RX/TX line short to ground/somewhere, etc?).

    let us know how you get on,
    br, Simon


    I will answer point by point:
    1- Yes, I confirm I can see debug logs on RX2/TX2
    2- Done, GND is ok and RX1 goes to TX of UART adapter and TX1 goes to RX of UART adapter
    3- Already checked, and I also tried different UART adapters
    4- Yes I read about that, but I tried almost 10 times (each time before posting here was 10 tries, and there are multiple posts :P) and it always shows as my previous pictures
    5- Tested with multimeter and RX1/TX1 are not shorted to ground

    Also, when I put CEN to GND I see some symbols on RX1/TX1 serial console, but it is not possible to read flash anyway... and I can see how it reboots on logs of debug port (RX2/TX2) but still bk writer says "Init... FAILED" or "AttributeError: 'NoneType' object has no attribute 'close'
    " on python

    P.D.: one more test, I had put a multimeter and I have 3.2x volts between TX1 and GND


    Can you try with raspberry and its uart port.
    I have had many problems for not enough power from FTDI.
  • #347 19936485
    eakeyson
    Level 6  
    eakeyson wrote:
    Hello,

    I am trying to flash a WB2L module with OpenBK7231T firmware. Relatively new here but have successfully flashed several ESPs with Tasmota.

    I can successfully flash with python CLI and 1st time, I did get AP and successfully configured WiFi and MQTT using OpenBK7231T_App_UA_1.0.0.bin. At first reboot after successful flash, all went away and now I can't get AP again despite flashing again several times. I have tried all of the pre-compiled binaries in the repo with no success. I have also double checked all the connections and confirmed absence of pull-up or pull-down resistors on pins.

    Here is the log output after boot:

    V:BK7231S_1.0.5
    CPSR:000000D3
    R0:77EDF0F6
    R1:2331136B
    R2:EED6FE63
    R3:5DB35B52
    R4:DF4B6338
    R13:732CE97F
    R14(LR):BCFF93B7
    ST:D1662661
    J 0x10000
    prvHeapInit-start addr:0x41ca60, size:144800
    [bk]tx_txdesc_flush
    Entering init log...
    Init log done!
    bk_pwm_stop:98

    Any suggestions on what to do next? Is this a BK7231S chip and not supported? Was the first time a fluke?

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant


    Anybody have any suggestions for me on this? I seem to be stuck...
  • #348 19936488
    pepesuriano
    Level 9  
    btsimonh wrote:

    How close are these logs (at least in the first few lines) to the log I posted from another device above?
    pls. post the first 20 lines of the log....
    (I'm not saying it will help! but if it is a different bootloader, then maybe it will show something.....)
    Which Beken chip is it? (n or t/s)?
    If you can't get serial to go, then there is the option of SPI... it's much more complicated and you do need a raspberry pi, access to the 4 SPI pins on the wifi module, etc :(.
    Else we have a few more weeks for the wifi OTA hack to come through - just make sure it does not receive a firmware update from Tuya (unlikely).
    :( simon


    It seems quite similar, here you have it:

    V:BK7231S_1.0.5
    CPSR:000000D3
    R0:D7EFFAFA
    R1:FE587B37
    R2:D2DCB351
    R3:BE6D65DF
    R4:3E0A3E9E
    R13:FFD5775F
    R14(LR):76F6F99D
    ST:04870CAC
    J 0x10000
    prvHeapInit-start addr:0x420030, size:131024
    [01-01 18:12:15 TUYA Info][mqc_app.c:175] mqc app init ...
    [01-01 18:12:15 TUYA Info][sf_mqc_cb.c:42] register mqc app callback
    [01-01 18:12:15 TUYA Debug][mqc_app.c:118] mq_pro:5 mqc_handler_cnt:1
    [01-01 18:12:15 TUYA Debug][mqc_app.c:118] mq_pro:31 mqc_handler_cnt:2
    [01-01 18:12:15 TUYA Debug][uni_thread.c:215] Thread:sys_timer Exec Start. Set to Running Status
    [01-01 18:12:15 TUYA Debug][log_seq.c:732] read from uf. max:1 first:1 last:0
    [01-01 18:12:15 TUYA Debug][svc_online_log.c:288] svc online log init success
    [01-01 18:12:15 TUYA Err][tuya_ws_db.c:314] kvs_read fails gw_bi -1
    [01-01 18:12:15 TUYA Err][ws_db_gw.c:111] gw base read fails -935
    [01-01 18:12:15 TUYA Debug][tuya_bt_sdk.c:89] ty bt cmmod register finish 1
    [01-01 18:12:15 TUYA Debug][tuya_ble_api.c:301] ble sdk inited
    !!!!!!!!!!tuya_bt_port_init

    I have a bus pirate and a SOIC8 clip if you want to try SPI, is there any documentation for it?

    absinth84 wrote:

    Can you try with raspberry and its uart port.
    I have had many problems for not enough power from FTDI.


    I don't have a RPI, but I tried with and arduino UNO, and it's not working just like with the PL2303...
  • #349 19936507
    p.kaczmarek2
    Moderator Smart Home
    eakeyson wrote:

    V:BK7231S_1.0.5
    CPSR:000000D3
    R0:77EDF0F6
    R1:2331136B
    R2:EED6FE63
    R3:5DB35B52
    R4:DF4B6338
    R13:732CE97F
    R14(LR):BCFF93B7
    ST:D1662661
    J 0x10000
    prvHeapInit-start addr:0x41ca60, size:144800
    [bk]tx_txdesc_flush
    Entering init log...
    Init log done!
    bk_pwm_stop:98
    Anybody have any suggestions for me on this? I seem to be stuck...

    It was most likely fixed today by me, by delaying the WiFi init by 5 seconds after startup.

    Commit link:
    https://github.com/openshwprojects/OpenBK7231...mmit/7c068a30c647a7ac889ca1949c1a5f31743e2a5e

    Here is the log how it happened for me on BK7231N:
    
       
    
    V:BK7231N_1.0.1
    
    REG:cpsr     spsr     r13      r14
    
    SVC:000000D3          00401C1C 000033AC
    
    IRQ:000000d2 00000010 00401e0c dce9f217 
    
    FIR:000000d1 00000010 00401ffc ede2ef73 
    
    SYS:000000df          0040192c 00000158 
    
    ST:00000000
    
    J 0x10000
    
    bk_misc_init_start_type 0 0
    prvHeapInit-start addr:0x410320, size:130272
    [Flash]id:0x1c7015
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering init log...
    Init log done!
    Commands registered!
    bandgap_calm_in_efuse=0x2e
    [load]bandgap_calm=0x2e->0x2e,vddig=4->4
    [FUNC]rwnxl_init
    [bk]tx_txdesc_flush
    [FUNC]intc_init
    [FUNC]calibration_main
    gpio_level=1,txpwr_state=0
    user define rfcali mode:1 
    get rfcali_mode:1
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    supplicant_main_exiting
    calibration_main over
    NO TXPWR_TAB_TAB found in flash
    Load default txpwr for b:0xa7cc8
    Load default txpwr for g:0xa7cd6
    fit n20 table with dist:4
    Load default txpwr for n40:0xa7ce4
    Load default txpwr for ble:0xa8b5d
    supplicant_main_exiting
    temp in flash is:350
    xtal in flash is:12
    xtal_cali:12
    --init_xtal = 12
    [FUNC]ps_init
    [FUNC]func_init_extended supplicant_main_exiting
    OVER!!!
    
    start_type:0
    Version:
    Initializing TCP/IP stack
    tcp_port:62642
    app_init finished
    supplicant_exit_d[sa_sta]MM_RESET_REQ
    

    after this log output the device was becoming silent forever until next power off and on cycle. Now it's fixed, at least for me.

    @eakeyson does this fix works for you? (of course I assume you know how to compile latest binary or at least get one from automatic binary builds we have available in github).


    PS: More supported devices and bugfixes coming soon, I am researching the first lightbulb in queue:
    Spoiler:

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    Please wait few days for detailed flashing guide (I will post it as separate article).

    Remember to check out those guides as well:
    https://www.elektroda.com/rtvforum/topic3874289.html
    https://www.elektroda.com/rtvforum/topic3875654.html

    @pepesuriano this is getting very strange. I'd recommend again trying the USB to TTL HW597 which I trust. If it still not working, then I'd bet that you still have some trivial mistake or error or something on RX or TX pin. The next thing i'd try (but I don't recommend it) would be desoldering whole chip (WB2S module?) with hot air and checking if it works outside the board.
    Helpful post? Buy me a coffee.
  • #350 19936523
    pepesuriano
    Level 9  
    p.kaczmarek2 wrote:

    @pepesuriano this is getting very strange. I'd recommend again trying the USB to TTL HW597 which I trust. If it still not working, then I'd bet that you still have some trivial mistake or error or something on RX or TX pin. The next thing i'd try (but I don't recommend it) would be desoldering whole chip (WB2S module?) with hot air and checking if it works outside the board.


    Ok I will show a picture to explain the best as I can:

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    I guess that this is very clear (TX1 to RX on UART adapter, RX1 to TX on UART adapter, and 5v/gnd to AMS1117 direct from USB port.

    Cheers
  • #351 19936524
    eakeyson
    Level 6  
    Nope. Still doesn't work for me.
    Compiled new app and wrote flash with new OpenBK7231T_App_UA_1.0.0.bin file. Output log is the same. Reprinted here:

    V:BK7231S_1.0.5
    CPSR:000000D3
    R0:77EDF0F6
    R1:2331136B
    R2:EED6FF63
    R3:5DB35B52
    R4:DF4B6338
    R13:F32BE97F
    R14(LR):BC7F93B7
    ST:D1662661
    J 0x10000
    prvHeapInit-start addr:0x41ce90, size:143728
    Entering init log...
    Init log done!
    Commands registered!
    [bk]tx_txdesc_flush
    bk_pwm_stop:98

    Then it hangs. No AP is started. Any further suggestions?
    Thanks for the help...

    Dodano po 5 [minuty]:

    pepesuriano wrote:
    p.kaczmarek2 wrote:

    @pepesuriano this is getting very strange. I'd recommend again trying the USB to TTL HW597 which I trust. If it still not working, then I'd bet that you still have some trivial mistake or error or something on RX or TX pin. The next thing i'd try (but I don't recommend it) would be desoldering whole chip (WB2S module?) with hot air and checking if it works outside the board.


    Ok I will show a picture to explain the best as I can:

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    I guess that this is very clear (TX1 to RX on UART adapter, RX1 to TX on UART adapter, and 5v/gnd to AMS1117 direct from USB port.

    Cheers


    Where did you get those clips to attach the Dupont cables to the PCB?
  • #352 19936673
    ExploWare
    Level 10  
    @pepesuriano my only advice is to link the GND from UART and USB powerline you feed into the AMS. The regulator on the serial might have a floating gnd (good from a safety perspective)
  • #353 19936791
    p.kaczmarek2
    Moderator Smart Home
    @eakeyson would it be possible that your SSID or pass was longer than 64 characters?

    Are those demos working for you?
    https://github.com/openshwprojects/OpenBK7231T/tree/master/apps/obk_demo_openAccessPoint
    https://github.com/openshwprojects/OpenBK7231T/tree/master/apps/obk_demo_scanNetworks



    pepesuriano wrote:

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    Where is the 3.3V logic levels selection jumper (assuming that's the USB to TTL converter similiar to the one I am using)?
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Helpful post? Buy me a coffee.
  • #354 19936801
    btsimonh
    Level 11  
    eakeyson wrote:
    Then it hangs

    just one more thought....
    I had a a strange thing on mine where logs stopped working - what it turned out to be was that I was trying to find the GPIO ports for the buttons on a device, and had set the pins to all inputs... and hence when it initialised them, the logs stopped (because it turned the TX line into an input!!!).
    How I got around this (before I realised I could have just reconfigured - i thought it was dead) was to flash a block of FF over the configuration flash area.
    So, determine the config flash area for you device, use a hex editor to make a 4k file full of ff.
    READ the flash area, confirm it's the area which contains the wifi details, then write it with the FF block.
    br, simon
  • #355 19938074
    eakeyson
    Level 6  
    p.kaczmarek2 wrote:
    @eakeyson would it be possible that your SSID or pass was longer than 64 characters?

    Are those demos working for you?
    https://github.com/openshwprojects/OpenBK7231T/tree/master/apps/obk_demo_openAccessPoint
    https://github.com/openshwprojects/OpenBK7231T/tree/master/apps/obk_demo_scanNetworks


    No, on SSID and pass more than 64 characters.
    Both demos seem to work: both create demo AP but not sure what to do with "obk_demo_scanNetworks" but it seems to be working otherwise.

    Next steps?
  • #356 19939093
    btsimonh
    Level 11  
    Avatar ASL04:

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    So, purchase from amazon £11. Fittings £29. (have enough to do the next one the wife wants!).

    Now will implement MQTT control in Node-Red so that my Alexa scenes I've setup will do what she wants :).
  • #357 19940256
    p.kaczmarek2
    Moderator Smart Home
    eakeyson wrote:

    Next steps?

    How much C experience do you have? I don't know if I should provide a short version, or a step by step version.
    Still, the next thing I'd do is try running with advanced logger disabled.
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/logging/logging.h
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Or maybe go with #define DEBUG_USE_SIMPLE_LOGGER 1 ....
    We need to know exactly where it's crashing..
    I might also try to prepare a recovery option for you (clear all config, just in case...)
    But first, is the current version also not working? After small buffer overrun fix added today to repo?

    @btsimonh , great setup!

    @pepesuriano any progress? Or maybe just find a shop where I can buy this device and I will figure it myself... just need a shop shipping to Poland!

    Some news:
    1. I found a serious bug in PWM code -PWM was not working on BK7231N but working on BK7231T. It seems the pwm_start works differently on N version.
    See fix:
    https://github.com/openshwprojects/OpenBK7231...mmit/c8184264f04f4654e177005b3ed0593da8fcabea
    2. I published polish version of BK7231N lightbulb RGBCW guide, along with flashing details (of course again no problems - I don't know how you guys get all these strange programming issues):
    https://www.elektroda.pl/rtvforum/topic3880540.html#19938487
    3. I am getting more test devices, of course I can't say for sure if they are BK7231, but even if they are ESP-based, I will still do a teardown and programming guide for our Elektroda Teardowns Section:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    It's gonna be good, do they really have 8 separate GPIOs used for relays, or maybe is there a MCU?
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    4. I think that BL602 support is possible, I have a BL602 lightbulb at hand (which has I2C RGBCW controller, btw...)
    Please remember that you can fund me buying more test devices by donating at https://www.paypal.com/paypalme/openshwprojects
    5. Polish TuyaMCU guide was released:
    https://www.elektroda.pl/rtvforum/topic3880546.html#19938505
    Helpful post? Buy me a coffee.
  • #358 19941264
    eakeyson
    Level 6  
    p.kaczmarek2 wrote:
    eakeyson wrote:

    Next steps?

    How much C experience do you have? I don't know if I should provide a short version, or a step by step version.
    Still, the next thing I'd do is try running with advanced logger disabled.
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/logging/logging.h
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Or maybe go with #define DEBUG_USE_SIMPLE_LOGGER 1 ....
    We need to know exactly where it's crashing..
    I might also try to prepare a recovery option for you (clear all config, just in case...)
    But first, is the current version also not working? After small buffer overrun fix added today to repo?


    Latest version of the app with recent repository changes hangs as before. I made the changes to logging.h with
    "#define DEFAULT_DIRECT_SERIAL_LOG 1" as you suggested and got the log:

    V:BK7231S_1.0.5
    CPSR:000000D3
    R0:77EDF0F6
    R1:2331136B
    R2:EED6FF63
    R3:5DB35B52
    R4:DF4B6338
    R13:B329E97F
    R14(LR):BCFF93B7
    ST:D1662661
    J 0x10000
    prvHeapInit-start addr:0x41ce90, size:143728
    Entering init log...
    Init log done!
    Debug:CMD:Adding command loglevel
    Debug:CMD:Adding command logfeature
    Debug:CMD:Adding command logtype
    Debug:CMD:Adding command logdelay
    Commands registered!
    Debug:CFG:flash vars not initialised - reading
    Debug:CFG:new offset after read 540, boot_count 66, success count 0
    Info:CFG:####### Boot Count 67 #######
    Debug:CFG:new offset 548, boot_count 67, success count 0
    Debug:CFG:new offset after read 548, boot_count 67, success count 0
    Debug:CFG:re-read - offset 548, boot count 67, boot success 0, bootfailures 67
    [bk]tx_txdesc_flush
    Info:GEN:PIN_LoadFromFlash called - going to load pins.

    Info:GEN:UART log breaking after that means that you changed the role of TX pin to digital IO or smth else.

    bk_pwm_stop:98

    It still hangs but I think it's something like @btsimonh said above. Now how to fix...

    Dodano po 2 [minuty]:

    btsimonh wrote:
    eakeyson wrote:
    Then it hangs

    just one more thought....
    I had a a strange thing on mine where logs stopped working - what it turned out to be was that I was trying to find the GPIO ports for the buttons on a device, and had set the pins to all inputs... and hence when it initialised them, the logs stopped (because it turned the TX line into an input!!!).
    How I got around this (before I realised I could have just reconfigured - i thought it was dead) was to flash a block of FF over the configuration flash area.
    So, determine the config flash area for you device, use a hex editor to make a 4k file full of ff.
    READ the flash area, confirm it's the area which contains the wifi details, then write it with the FF block.
    br, simon


    Yes, when I did get it to boot the first time I did try to configure some pins. It acts like it still sets that configuration which prevents it from booting.

    How do I do what you suggest? Can I use the your python flasher or do I have to use RPi and SPI interface? Either way, I would appreciate more explicit instructions if I am going to try this.
  • #359 19941314
    p.kaczmarek2
    Moderator Smart Home
    eakeyson wrote:

    Yes, when I did get it to boot the first time I did try to configure some pins. It acts like it still sets that configuration which prevents it from booting.

    There is a simple check that prevents config from disabling UART pins, that is commented out right now.
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/new_pins.c
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    if you uncomment those lines, config and web page won't be able to change roles of pin P0, P1, P10 and P11:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Of course, everything here is under assumption that you're getting silence because you've set UART pin role to something else...
    but try, uncomment shown lines, recompile, flash and give us full log.


    In the past, there was also a real boot crash/hang issue but I think it's fixed since several days (I hope)
    Helpful post? Buy me a coffee.
  • #360 19941405
    btsimonh
    Level 11  
    eakeyson wrote:
    Can I use the your python flasher or do I have to use RPi and SPI interface? Either way, I would appreciate more explicit instructions if I am going to try this

    yes, but I can't give you the numbers or exact instructions as the laptop I use is on loan to my daughter for a few days :(.
    If it IS uart pins re-assigned, this should not stop it creating an access point (or joining the network if configured), and then you can reconfigure the pins....

Topic summary

The discussion revolves around the development and implementation of custom firmware for devices using the BK7231T and BK7231N chips, particularly focusing on creating a mini HTTP server, MQTT support, and integration with Home Assistant. Users share their experiences flashing various smart devices, troubleshooting issues related to UART connections, and configuring GPIO pins for different functionalities. The conversation also touches on the challenges of maintaining WiFi connectivity, the importance of proper pin configuration, and the potential for using I2C for additional device control. Several users report successful firmware updates and the addition of new features, including support for various sensors and devices.
Summary generated by the language model.
ADVERTISEMENT