Navážu dost volně. Začínám a nechal jsem se (taky) napálit. Koukal jsem na stará videa na YT a zaradoval se, že za pár korun budu mít modbus TCP krabičku. No dopadl jsem jak jsem dopadl, tedy krabička se dá použít jen na prvotní nastavení a dále pak cloud nebo popelnice. Volba byla jasná - popelnice (tedy elektroodpad).
Ještě před vyhozením jsem si řekl, že se alespoň podívám dovnitř. Kromě obřího (na poměry desky) RJ-45 konektoru jsem objevil další konektor perfektně popsaný - GND, RX, TX, 3V3 a RST. No tomu jsem nemohl odolat.
Nejprve jsem zkoušel ESPtool, ale nic. Pak jsem připojil terminál a ejhle:
- Kód: Vybrat vše
[SFUD]Warning: Read SFDP parameter header information failed. The norflash is not support JEDEC SFDP.
[SFUD]Warning: This flash device is not found or not support.
[SFUD]Warning: Read SFDP parameter header information failed. The norflash is not support JEDEC SFDP.
[SFUD]Warning: This flash device is not found or not support.
[SFUD]Error: norflash flash device is initialize fail.
[I/FAL] RT-Thread Flash Abstraction Layer (V0.4.0) initialize success.
[E/OTA] (ota_main:41) download partition is not exist, please check your configuration!
[D/OTA] (ota_main:105) jump to APP!
redirect_addr:8010100, stk_addr:20005800, len:851968
\ | /
- RT - Thread Operating System
/ | \ 4.0.2 build Oct 11 2021
2006 - 2019 Copyright by rt-thread team
lwIP-2.0.2 initialized!
ERROR: SPI device fl_spi not found!
[I/sal.skt] Socket Abstraction Layer initialize success.
[D/FAL] (fal_flash_init:61) Flash device | w60x_onchip | addr: 0x08000000 | len: 0x00100000 | blk_size: 0x00001000 |initia.
ERROR: Flash device w25q128 not found!
[D/FAL] (fal_flash_init:61) Flash device | norflash | addr: 0x00000000 | len: 0x00000000 | blk_size: 0x00000000 |initia.
[D/FAL] (fal_partition_init:176) Find the partition table on 'w60x_onchip' offset @0x0000ff88.
[I/FAL] ==================== FAL partition table ====================
[I/FAL] | name | flash_dev | offset | length |
[I/FAL] -------------------------------------------------------------
[I/FAL] | app | w60x_onchip | 0x00010100 | 0x000d0000 |
[I/FAL] | easyflash | w60x_onchip | 0x000e0100 | 0x00004000 |
[I/FAL] | filesystem | w60x_onchip | 0x000e4100 | 0x00019000 |
[I/FAL] =============================================================
[I/FAL] RT-Thread Flash Abstraction Layer (V0.3.0) initialize success.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:152) ENV start address is 0x00000000, size is 8192 bytes.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:821) Calculate ENV CRC32 number is 0xD6114A34.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:833) Verify ENV CRC32 result is OK.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:821) Calculate ENV CRC32 number is 0x78CA81B2.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:833) Verify ENV CRC32 result is OK.
[Flash] EasyFlash V3.3.0 is initialize success.
[Flash] You can get the latest version on https://github.com/armink/EasyFlash .
<--------------------software: GT100WS138W600T------------------>
tls_fls_init() return 2
init MyFile obj is success.
enter InitHnjdClass() success.
ql_dev_init()=0
<-- lt_sock_para_1() APP_NV_SYS=,ret=0. ID=00062397 -->
<--init0 hnjd paraments success loraSize=0-->
Hnjd_GetImei(), imei:202111232127292;
<--init hnjd paraments success loraSize=0-->
init gpio class success.
RT-Thread create eventUart2Recv successful
init serial class success.
init logs class success.
Hnjd_GetImei(void), imei:202111232127292;
SecCount=-1,SendCount=0
SecCount=-1,SendCount=0
COM<-- 89 D2 D4 D2 D3 D3 D3 D2 D1 D2 D3 D2 CD D2 CB D2 00 D4 D4 D4 D4 D4 D4 23 1D A8 88
msh />gpio task running......
serial task2 running......
COM--> 89 D2 D4 D2 D3 D3 D3 D2 D1 D2 D3 D2 CD D2 CB D2 00 D2 D4 D4 CC D4 D3 23 1D 9D 88
TEA success.
init system success.
[D/DFS] enter AP mode
[I/WLAN.dev] wlan init success
[I/WLAN.lwip] eth device init ok name:w0
[I/WLAN.mgnt] start ap successs!
[D/DFS] rt_wlan_start_ap(HN_62397,12345678) return RT_EOK.
[D/DFS] main() enter UserMain()
enter InitSockClass()
exit InitSockClass()
[DHCP] dhcpd_start: w0
[DHCP] ip_start: [192.168.169.2]
[DHCP] ip_start: [192.168.169.254]
enter lt_RtuTask()
local ip:0.0.0.0 port:65010
TCPServer Waiting for client on port 65010...
RT-Thread create eventSockSendRecv successful
serial init success. baud=115200,parity=8N1
lt_TcpServer_MainOnline() timer out .the system will restart.
msh />lt_TcpServer_MainOnline() timer out .the system will restart.
lt_TcpServer_MainOnline() timer out .the system will restart.
lt_TcpServer_MainOnline() timer out .the system will restart.
RT-Thread operating system je tohle:
https://www.rt-thread.iomshell je (částečně) popsaný zde:
https://www.rt-thread.io/document/site/ ... nsh/finsh/Seznam příkazů se zobrazí tabelátorem
- Kód: Vybrat vše
RT-Thread shell commands:
setenv - Set an envrionment variable.
printenv - Print all envrionment variables.
saveenv - Save all envrionment variables to flash.
getvalue - Get an envrionment variable by name.
resetenv - Reset all envrionment variable to default.
fal - FAL (Flash Abstraction Layer) operate.
ntp_sync - Update time by NTP(Network Time Protocol): ntp_sync [host_name]
list_fd - list file descriptor
date - get date and time or set [year month day hour min sec]
sf - SPI Flash operate.
wifi - wifi command.
version - show RT-Thread version information
list_thread - list thread
list_sem - list semaphore in system
list_event - list event in system
list_mutex - list mutex in system
list_mailbox - list mail box in system
list_msgqueue - list message queue in system
list_memheap - list memory heap in system
list_mempool - list memory pool in system
list_timer - list timer in system
list_device - list device in system
help - RT-Thread shell help.
ls - List information about the FILEs.
cp - Copy SOURCE to DEST.
mv - Rename SOURCE to DEST.
cat - Concatenate FILE(s)
rm - Remove(unlink) the FILE(s).
cd - Change the shell working directory.
pwd - Print the name of the current working directory.
mkdir - Create the DIRECTORY.
mkfs - format disk with file system
df - disk free
echo - echo string to file
ps - List threads in the system.
time - Execute command with time.
free - Show the memory usage in the system.
ifconfig - list the information of all network interfaces
ping - ping network host
dns - list and set the information of dns
netstat - list the information of TCP / IP
smartconfig_demo - smartconfig demo
reboot - Reboot System
Podařilo se mi částečně uspět, tedy vypnout AP a připojit se na wifi v režimu STA. Postup:
- Kód: Vybrat vše
wifi ap_stop
smartconfig_demo # bez tohoto následující příkaz nefunguje, nevím proč
wifi join [SSID] [PASSWORD]
a jsem na wifině. Bohužel bez IP adresy a krabice tvrdošíjně odmítá vyžádat si IP z DHCP. Ruční konfigurace mi zařve a zatím se mi nepodařilo to překonat, asi jsem dost blízko, ale možná to prostě (zatím?) nepůjde.
Kdi si chcete hrát, rozebírá se to snadno, pak je potřeba desku vypáčit např. šroubovákem, je na to potřeba relativně dost síly a páčit těsně u kapek houževnaté a tuhé hmoty, kterou je deska přilepená. Pak se nezlomí, teda mně se nezlomila.
Logika je, jak nápis napovídá, 3.3V, tedy 5V byste to mohli odprásknout. Připojení UARTu je dvoudrátové, tedy žádný flow control, 115200 8N1
- Kód: Vybrat vše
msh />wifi ap_stop
[I/WLAN.mgnt] ap stop success!
msh />smartconfig_demo
[I/DBG] config_type:AIRKISS
[I/WLAN.dev] wlan init success
[I/WLAN.lwip] eth device init ok name:w1
msh />wifi join mojessid mojepassword
[I/WLAN.mgnt] wifi connect success ssid:mojessid
msh />wifi status
Wi-Fi STA Info
SSID : mojessid
MAC Addr: mojemekadresa
Channel: 3
DataRate: 144Mbps
RSSI: -42
wifi ap not start!
Auto Connect status:Disable!
msh />ifconfig
network interface device: w0 (Default)
MTU: 1500
4.MAC: 2A 6D CD 95 51 3E
FLAGS: UP LINK_DOWN INTERNET_DOWN DHCP_ENABLE ETHARP BROADCAST IGMP
ip address: 192.168.169.1
gw address: 0.0.0.0
net mask : 255.255.255.0
dns server #0: 0.0.0.0
dns server #1: 0.0.0.0
network interface device: w1
MTU: 1500
4.MAC: 28 6D CD 95 51 3E
FLAGS: UP LINK_UP INTERNET_DOWN DHCP_ENABLE ETHARP BROADCAST IGMP
ip address: 0.0.0.0
gw address: 0.0.0.0
net mask : 0.0.0.0
dns server #0: 0.0.0.0
dns server #1: 0.0.0.0
msh />ifconfig w1 192.168.33.100 192.168.33.1 255.255.255.0
config : w1
IP addr: 192.168.33.100
Gateway: 192.168.33.1
netmask: 255.255.255.0
[E/netdev] The network interface device(w1) DHCP capability is enable, not support set IP address.
[E/netdev] The network interface device(w1) DHCP capability is enable, not support set gateway address.
[E/netdev] The network interface device(w1) DHCP capability is enable, not support set netmask address.
msh />
No a dál jsem se nedostal. W0 je interface s AP, W1 je interface STA.
Hodně úspěchů při konfigurování/flashování