2025-10-28 3:47 AM - last edited on 2025-11-13 12:43 AM by SimonePradolini
Device : STWIN.Box (steval stwbxcs1a) with DATALOG2 3.1.0 firmware.
WIFI : Updated the MXCHIP firmware
Objective: Running WiFi connection with APP and/or PnPL messages, Data retrieving with FTP.
Currently this is my application as viewed in ST BLE Sensor app (iOS)
I have first tried with the iOS app, it doesn't let me to use the Wifi connect button or disconnect.
Then, I tried using PnPL messages with PythonSDK ( Board is connected by USB):
message = PnPLCMDManager.create_set_property_cmd("wifi_config", "ssid", "Nothing")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
message = PnPLCMDManager.create_command_cmd("wifi_config", "wifi_connect" , "password", "11223344")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
message = PnPLCMDManager.create_set_property_cmd("wifi_config", "ip", "0.0.0.0")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
time.sleep(30)
message = PnPLCMDManager.create_command_cmd("wifi_config", "wifi_disconnect" ,"ssid", "Nothing")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
I get these messages in terminal
{"wifi_config": {"ssid": "Nothing"}}
2025-10-28 12:30:51,645 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"PnPL_Response":{"message":"","value":"Nothing","status":true}}
{"PnPL_Response":{"message":"","value":"Nothing","status":true}}
{"wifi_config*wifi_connect": {"password": "11223344"}}
None
{"wifi_config": {"ip": "0.0.0.0"}}
None
{"wifi_config*wifi_disconnect": {"ssid": "Nothing"}}
2025-10-28 12:31:23,726 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"PnPL_Response":{"message":"","status":true}}
{"PnPL_Response":{"message":"","status":true}}
and this screenshot from the computer that a device is connected :
MAC address prefix 84:9D:C2 is registered to Shanghai MXCHIP Information Technology Co., Ltd., ( Google )
and in my ST BLE iOS App,
So far, I could not get the wifi working as expected,
Issue#1 : Can't configure WIFI in IOS app. Hence, can not verify FTP properly.
Issue#2 : Configuring with PnPL is confusing. Some commands responses back with PnPL some None (wifi connect with password and ip set is showing None without any PnPL response.) This procedure makes the board unresponsive with the USB connection to PythonSDK, so a board reset is needed to run the commands again else it doesn't detect the board anymore. Could be the previous PnPL messages were structured wrong thus makes it unresponsive to USB.
Issue#3: The device gets connected ( viewed in hotspot laptop) and disconnected PnPL message can be received in Terminal.
Issue#4: FTP retrieval in this situation, i have only until WIFI connect command and it is connected. Following the ST WIFI FTP connect guide for datalog2, my device is not responsive. Here is the FileZilla screenshot
or inside command prompt
C:\Users\xx> ftp 192.168.137.104
Connected to 192.168.137.104.
220 Connection Ready
530 Not logged in
User (192.168.137.104:(none)): anonymous
331 Enter password
Password:
230 Logged in
ftp> dir
200 Port set
550 Bad Directory
ftp>
What steps needs to be changed to be able to use WIFI with the APP or only PnPL to properly use the FTP as described in this document
Solved! Go to Solution.
2025-11-27 9:30 AM
Hello @frogrammer
I modified stdatalog_API_examples_HSDLink.py, adding the above code after the get_device_info:
message = PnPLCMDManager.create_set_property_cmd("wifi_config", "ssid", "IoTST")
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
message = PnPLCMDManager.create_command_cmd("wifi_config", "wifi_connect" , "password", "iot12345")
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
# Pause execution for 10 seconds - need to wait for wifi connection to establish
time.sleep(10)
# Ping the device to check connectivity
message = "{}"
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
# Get Component status (e.g. wifi_config)
message = "{\"get_status\":\"wifi_config\"}"
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
Here’s the terminal output:
{"wifi_config": {"ssid": "IoTST"}}
2025-11-27 18:14:20,971 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"PnPL_Response":{"message":"","value":"IoTST","status":true}}
{"wifi_config*wifi_connect": {"password": "iot12345"}}
{}
2025-11-27 18:14:32,013 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"PnPL_Response":{"message":"","status":true}}
{"get_status":"wifi_config"}
2025-11-27 18:14:32,044 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"wifi_config":{"ssid":"IoTST","ip":"192.168.0.104","ftp_username":"anonymous","c_type":2}}
The actual implementation (no blocking responses with command via USB) implies a sleeping time + sending and ack/void message to let the USB communication restarting working properly.
It’s a limitation because we're not supposed to support this kind of paradigm.
The code I shared can represent a sort of workaround.
Best regards,
Simone
2025-10-29 3:26 AM - edited 2025-10-29 3:28 AM
A small update to the FTP retrieval.
2025-11-13 12:41 AM
Hello @frogrammer
I'm sorry, but I completely lost your question. Sorry for the late reply.
Let me start from you last point:
@frogrammer wrote:What steps needs to be changed to be able to use WIFI with the APP or only PnPL to properly use the FTP as described in this document
The document you’re sharing refers to STEVAL-PDETECT board and PDETECT firmware example distributed in FP-SNS-DATALOG2. The function pack contains different firmware example and the PDETECT one isn’t enabling Wi-Fi or FTP. The Quick Start guide that you’re citing isn’t describing the steps to configure an FTP server because the firmware example isn’t supporting it. I'm sorry, but FTP is supported only in DATALOG2 example for STEVAL-STWINBX1, as described both in User Manual chapter 2.3 and in Quick Start Guide section 2.1.5. If you found out that the documentation isn’t clear enough, I can modify it to underline the above aspects explicitly.
Regarding instead the rest of your question: are you using DATALOG2 or PDETECT binary? As already said, PDETECT can't work at all. DATALOG2 instead is expected to work properly. FTP server must be enabled and used via the BLESensor app only as described in the document cited above natively. There’s no ready-to-use Python script to enable FTP via USB commands.
Let me cite here another thread in the community. The customer is developing a different use case, but still using Python to interact with the board and to enable a USB-based solution for something BLE/SDcard related. Maybe it can help you. Here are a couple of hints I already shared on that thread (and you’ll find also there) that you must consider while developing your Python application:
Best regards,
Simone
2025-11-13 2:49 AM
In my case, I am using Datalog2 and STwinbox. I believe this supports FTP. I have referred to the documentation of PDETECT only to know how to enable FTP server using the ST BLE Sensor app. My final target is to use PnPL command to enable the FTP server.
So far I am using USB connection to send PnPL commands for WIFI and FTP.
After sending these commands the STWINBOX connects to wifi and i could view data in FTP as i described already, but those commands doesn’t show any PnPL response true back to my Terminal instead prints out „None“ and no more commands can be sent such as „ get all“ status commands, because the Python SDK can not find the board. Meantime, i could see the FTP server enabled ( i have to get the IP from my router and then using Command prompt FTP … )
The problem is, if i can not send any more commands such as „get all“ i can not automate the process without knowing the IP of the board.
Thus, I am asking if my process of connecting to wifi or the PnPL messages are valid in sequence.
2025-11-14 7:20 AM
Hello @frogrammer
I got your point, but I need to ask internally and dig a bit into the code before give you an exhaustive answer.
You're building an interesting application. I'm giving higher priority to your request, ask for internal support and come back to you in a couple of days.
Best regards,
Simone
2025-11-19 3:53 AM
Hello @frogrammer
I'm still working to give you a complete support, so I can only give you a first partial answer.
Regarding missing responses to Wi-Fi commands: effectively they are missing into the DATALOG2 firmware. While for set PnPL properties there’s an automatic response mechanism, this isn’t the case for the PnPL commands. Unfortunately, they haven’t been implemented for Wi-Fi- commands because they weren’t needed for the BLE-only use case we were supporting until now.
I can work to add this feature for the next DATALOG2 release. I'll keep you informed.
Furthermore, I'll give you feedback about the second question on the impossibility to send further messages after connection.
Best regards,
Simone
2025-11-24 12:35 AM
Hello @frogrammer
Let me share a couple of updates.
The iOS application has just been fixed internally. The patched application will be pushed on the app store in a few days.
Although Wi-Fi commands aren’t replying with a response/acknowledge, I'm able to enable the connection and open the FTP server by sending PnPL commands via USB using PYSDK. Those commands are well formatted, thus allowing the communication.
message = PnPLCMDManager.create_set_property_cmd("wifi_config", "ssid", "Nothing")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
message = PnPLCMDManager.create_command_cmd("wifi_config", "wifi_connect" , "password", "11223344")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
I tested with a couple of boards on 2 different Windows PCs: after opening the FTP, I'm able to send further commands. For example, the following commands are working as expected.
# Get Device status
message = "{\"get_status\":\"all\"}"
print(hsd_link.send_command(hsd_link_instance, device_id, message))
message = PnPLCMDManager.create_get_device_status_cmd()
print(hsd_link.send_command(hsd_link_instance, device_id, message))
# Get Component status (e.g. wifi_config)
component_name = "wifi_config"
message = "{\"get_status\":\"wifi_config\"}"
print(hsd_link.send_command(hsd_link_instance, device_id, message))
message = PnPLCMDManager.create_get_component_status_cmd(component_name)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
Can you check and give me further feedback?
Best regards,
Simone
2025-11-25 3:00 AM
I have put this code together
message = PnPLCMDManager.create_set_property_cmd("wifi_config", "ssid", "Nothing")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
message = PnPLCMDManager.create_command_cmd("wifi_config", "wifi_connect" , "password", "11223344")
print(message)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
# Get Component status (e.g. wifi_config)
component_name = "wifi_config"
message = "{\"get_status\":\"wifi_config\"}"
print(hsd_link.send_command(hsd_link_instance, device_id, message))
message = PnPLCMDManager.create_get_component_status_cmd(component_name)
print(hsd_link.send_command(hsd_link_instance, device_id, message))
and i get
2025-11-25 11:57:41,669 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - Platform Architecture: 64bit
2025-11-25 11:57:42,304 - HSDatalogApp.stdatalog_core.HSD_link.HSDLink - INFO - Commmunication Opened correctly
HSDLink Version: High Speed Datalog DLL v2
Creating Commands
{"wifi_config": {"ssid": "Nothing"}}
2025-11-25 11:57:42,900 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"PnPL_Response":{"message":"","value":"Nothing","status":true}}
{"PnPL_Response":{"message":"","value":"Nothing","status":true}}
{"wifi_config*wifi_connect": {"password": "11223344"}}
None
None
None
---> End of HSDLink APIs test script.
In my case it doesn't show me the output, same issue. could you put the exact code or codes sequence in the comment box?
2025-11-27 9:30 AM
Hello @frogrammer
I modified stdatalog_API_examples_HSDLink.py, adding the above code after the get_device_info:
message = PnPLCMDManager.create_set_property_cmd("wifi_config", "ssid", "IoTST")
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
message = PnPLCMDManager.create_command_cmd("wifi_config", "wifi_connect" , "password", "iot12345")
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
# Pause execution for 10 seconds - need to wait for wifi connection to establish
time.sleep(10)
# Ping the device to check connectivity
message = "{}"
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
# Get Component status (e.g. wifi_config)
message = "{\"get_status\":\"wifi_config\"}"
print(message)
hsd_link.send_command(hsd_link_instance, device_id, message)
Here’s the terminal output:
{"wifi_config": {"ssid": "IoTST"}}
2025-11-27 18:14:20,971 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"PnPL_Response":{"message":"","value":"IoTST","status":true}}
{"wifi_config*wifi_connect": {"password": "iot12345"}}
{}
2025-11-27 18:14:32,013 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"PnPL_Response":{"message":"","status":true}}
{"get_status":"wifi_config"}
2025-11-27 18:14:32,044 - HSDatalogApp.stdatalog_core.HSD_link.communication.PnPL_HSD.hsd_dll - INFO - PnPL Response: {"wifi_config":{"ssid":"IoTST","ip":"192.168.0.104","ftp_username":"anonymous","c_type":2}}
The actual implementation (no blocking responses with command via USB) implies a sleeping time + sending and ack/void message to let the USB communication restarting working properly.
It’s a limitation because we're not supposed to support this kind of paradigm.
The code I shared can represent a sort of workaround.
Best regards,
Simone
2025-11-27 11:37 AM
Thanks @SimonePradolini it worked as intended. Hopefully i would be able to implement it now through BLE and also the IOS app would be fixed.