<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: QuecPython</title>
    <description>The latest articles on DEV Community by QuecPython (@quecpython).</description>
    <link>https://dev.to/quecpython</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3863424%2Fc87ebe15-e9c2-4be7-872c-2ac9b21acfd4.png</url>
      <title>DEV Community: QuecPython</title>
      <link>https://dev.to/quecpython</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/quecpython"/>
    <language>en</language>
    <item>
      <title>QuecPython + Qrcode: Generate QR Codes Quickly</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 22 May 2026 11:02:27 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-qrcode-generate-qr-codes-quickly-27eh</link>
      <guid>https://dev.to/quecpython/quecpython-qrcode-generate-qr-codes-quickly-27eh</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;QuecPython provides a concise and efficient QR code generation and display solution. Developers only need to call one line of code to present a QR code on the device screen, significantly lowering the development threshold for information interaction in IoT devices. This feature is perfectly compatible with various screen-equipped modules, supports standard formats such as text, URLs, and WiFi configurations, and allows customization of size and colors. It can be quickly applied to scenarios like device provisioning and information display. Through highly encapsulated API design, QuecPython makes QR code function development unprecedentedly simple and efficient, helping developers easily implement convenient interaction between devices and mobile phones.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Advantages&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Minimalist Invocation&lt;/strong&gt;: No need for complex graphics libraries, display QR codes directly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intelligent Adaptation&lt;/strong&gt;: Automatically matches screen resolution&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-content Support&lt;/strong&gt;: Supports formats such as URLs, text, and contact information&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Typical Application Scenarios&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Device Provisioning: Display WiFi connection QR codes for one-click network configuration&lt;/li&gt;
&lt;li&gt;Information Exchange: Share device serial numbers, configuration information, and other key data&lt;/li&gt;
&lt;li&gt;Webpage Redirection: Display links to product official websites and technical documents&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Feature Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;### QR Code Display&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method is used to display a QR code on the LCD.&lt;/p&gt;

&lt;p&gt;qrcode.show(qrcode_str, magnification, start_x, start_y, Background_color, Foreground_color)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameter Description:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;qrcode_str - string type, QR code content (required)&lt;/li&gt;
&lt;li&gt;magnification - int type, magnification factor &lt;a href="https://dev.torequired"&gt;1, 6&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;start_x - int type, starting X coordinate for QR code display (required)&lt;/li&gt;
&lt;li&gt;start_y - int type, starting Y coordinate for QR code display (required)&lt;/li&gt;
&lt;li&gt;Background_color - int type, background color (hexadecimal), default: 0xffffff (white)&lt;/li&gt;
&lt;li&gt;Foreground_color - int type, foreground color (hexadecimal), default: 0x000000 (black)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Application Example&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Note: Before using the QR code function, you must initialize the LCD first.&lt;/p&gt;

&lt;p&gt;LCD initialization program reference: &lt;a href="https://github.com/QuecPython/QuecPython_lib_bundles/tree/master/libraries/LCD" rel="noopener noreferrer"&gt;https://github.com/QuecPython/QuecPython_lib_bundles/tree/master/libraries/LCD&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use QuecPython series development boards and LCD screens to implement QR code display.&lt;/p&gt;

&lt;p&gt;import qrcode&lt;/p&gt;

&lt;p&gt;qrcode.show("python.quectel.com", 6, 45, 45, 0xffffff, 0x00ff00)&lt;/p&gt;

&lt;p&gt;After entering the above code in the QPYcom interactive tool, the QR code will be successfully generated&lt;/p&gt;

&lt;p&gt;Scan the generated QR code with a mobile phone to quickly access the QuecPython official website&lt;/p&gt;

</description>
      <category>python</category>
      <category>iot</category>
      <category>micropython</category>
      <category>qrcode</category>
    </item>
    <item>
      <title>QuecPython + Alibaba Cloud IoT: Quick Connection to Alibaba Cloud IoT Platform</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 22 May 2026 10:55:44 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-alibaba-cloud-iot-quick-connection-to-alibaba-cloud-iot-platform-543n</link>
      <guid>https://dev.to/quecpython/quecpython-alibaba-cloud-iot-quick-connection-to-alibaba-cloud-iot-platform-543n</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With the rapid development of IoT technology, cloud platforms have become the core hub connecting the physical and digital worlds. QuecPython deeply integrates with the Alibaba Cloud IoT Platform (aLiYun) to launch an integrated "device + cloud" development solution, providing IoT developers with out-of-the-box cloud connectivity capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Advantages&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Minimalist Development Interface&lt;/strong&gt;: Through Pythonic API design, complex underlying operations such as MQTT protocol stacks, security authentication, and data encoding/decoding are encapsulated into concise method calls, eliminating the need for complex low-level driver writing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comprehensive Documentation&lt;/strong&gt;: Each API interface comes with detailed usage instructions, allowing developers to easily design and implement projects by following the documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Feature Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This article mainly introduces how to use QuecPython series modules to connect to the Alibaba Cloud IoT Platform and perform data subscription and publishing. The general connection process is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initialize the Alibaba Cloud IoT Platform&lt;/li&gt;
&lt;li&gt;Configure related functions and callbacks&lt;/li&gt;
&lt;li&gt;Implement subscription and publishing functions&lt;/li&gt;
&lt;li&gt;Start and stop connections&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Initialize Alibaba Cloud IoT Platform&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to configure product and device information for the Alibaba IoT Platform IoT Suite and returns an aLiYun connection object.&lt;/p&gt;

&lt;p&gt;aLiYun(productKey, productSecret, DeviceName, DeviceSecret, MqttServer)&lt;/p&gt;

&lt;p&gt;Run&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to aLiYun.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Configure Related Functions and Callbacks&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;MQTT Parameter Configuration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to set MQTT data channel parameters.&lt;/p&gt;

&lt;p&gt;aLiYun.setMqtt(clientID, clean_session, keepAlive=300, reconn=True)&lt;/p&gt;

&lt;p&gt;Run&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to aLiYun.setMqtt.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Callback Registration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to register callback functions.&lt;/p&gt;

&lt;p&gt;aLiYun.setCallback(callback)&lt;/p&gt;

&lt;p&gt;Run&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to aLiYun.setCallback.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Subscription and Publishing&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Subscribe&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to subscribe to MQTT topics.&lt;/p&gt;

&lt;p&gt;aLiYun.subscribe(topic, qos)&lt;/p&gt;

&lt;p&gt;Run&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to aLiYun.subscribe.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Publish&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to publish messages.&lt;/p&gt;

&lt;p&gt;aLiYun.publish(topic, msg, qos=0)&lt;/p&gt;

&lt;p&gt;Run&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to aLiYun.publish.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Start and Stop Functions&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Start Connection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to initiate the connection.&lt;/p&gt;

&lt;p&gt;aLiYun.start()&lt;/p&gt;

&lt;p&gt;Run&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to aLiYun.start.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Close Connection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to terminate the connection.&lt;/p&gt;

&lt;p&gt;aLiYun.disconnect()&lt;/p&gt;

&lt;p&gt;Run&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to aLiYun.disconnect.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Application Example&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;import log&lt;/p&gt;

&lt;p&gt;import utime&lt;/p&gt;

&lt;p&gt;import checkNet&lt;/p&gt;

&lt;p&gt;from aLiYun import aLiYun&lt;/p&gt;

&lt;p&gt;'''&lt;/p&gt;

&lt;p&gt;The following two global variables are required. Users can modify their values according to their actual project needs&lt;/p&gt;

&lt;p&gt;'''&lt;/p&gt;

&lt;p&gt;PROJECT_NAME = "QuecPython_AliYun_example"&lt;/p&gt;

&lt;p&gt;PROJECT_VERSION = "1.0.0"&lt;/p&gt;

&lt;p&gt;checknet = checkNet.CheckNetwork(PROJECT_NAME, PROJECT_VERSION)&lt;/p&gt;

&lt;h1&gt;
  
  
  Set log output level
&lt;/h1&gt;

&lt;p&gt;log.basicConfig(level=log.INFO)&lt;/p&gt;

&lt;p&gt;aliYun_log = log.getLogger("ALiYun")&lt;/p&gt;

&lt;p&gt;productKey = "" # Product identifier (refer to Alibaba IoT Platform application development guide)&lt;/p&gt;

&lt;p&gt;productSecret = None # Product secret (pass None when using one-device-one-secret authentication, refer to Alibaba IoT Platform application development guide)&lt;/p&gt;

&lt;p&gt;DeviceName = "" # Device name (refer to Alibaba IoT Platform application development guide)&lt;/p&gt;

&lt;p&gt;DeviceSecret = "" # Device secret (pass None when using one-product-one-secret authentication. Pre-registration-free is not supported yet. Devices must be created on the IoT Platform first. Refer to Alibaba IoT Platform application development guide)&lt;/p&gt;

&lt;p&gt;state = 5&lt;/p&gt;

&lt;h1&gt;
  
  
  Callback function
&lt;/h1&gt;

&lt;p&gt;def sub_cb(topic, msg):&lt;/p&gt;

&lt;p&gt;global state&lt;/p&gt;

&lt;p&gt;aliYun_log.info("Subscribe Recv: Topic={}, Msg={}".format(topic.decode(), msg.decode()))&lt;/p&gt;

&lt;p&gt;state -= 1&lt;/p&gt;

&lt;p&gt;if name == '&lt;strong&gt;main&lt;/strong&gt;':&lt;/p&gt;

&lt;p&gt;stagecode, subcode = checknet.wait_network_connected(30)&lt;/p&gt;

&lt;p&gt;if stagecode == 3 and subcode == 1:&lt;/p&gt;

&lt;p&gt;aliYun_log.info('Network connection successful!')&lt;/p&gt;

&lt;p&gt;# Create Alibaba Cloud connection object&lt;/p&gt;

&lt;p&gt;ali = aLiYun(productKey, productSecret, DeviceName, DeviceSecret)&lt;/p&gt;

&lt;p&gt;# Set MQTT connection properties&lt;/p&gt;

&lt;p&gt;clientID = "" # Custom string (no more than 64 characters)&lt;/p&gt;

&lt;p&gt;ali.setMqtt(clientID, clean_session=False, keepAlive=300)&lt;/p&gt;

&lt;p&gt;# Set callback function&lt;/p&gt;

&lt;p&gt;ali.setCallback(sub_cb)&lt;/p&gt;

&lt;p&gt;topic = "" # Custom or owned topic on the IoT Platform&lt;/p&gt;

&lt;p&gt;# Subscribe to topic&lt;/p&gt;

&lt;p&gt;ali.subscribe(topic)&lt;/p&gt;

&lt;p&gt;# Publish message&lt;/p&gt;

&lt;p&gt;ali.publish(topic, "hello world")&lt;/p&gt;

&lt;p&gt;# Start connection&lt;/p&gt;

&lt;p&gt;ali.start()&lt;/p&gt;

&lt;p&gt;while 1:&lt;/p&gt;

&lt;p&gt;if state:&lt;/p&gt;

&lt;p&gt;pass&lt;/p&gt;

&lt;p&gt;else:&lt;/p&gt;

&lt;p&gt;ali.disconnect()&lt;/p&gt;

&lt;p&gt;break&lt;/p&gt;

&lt;p&gt;else:&lt;/p&gt;

&lt;p&gt;aliYun_log.info('Network connection failed! stagecode = {}, subcode = {}'.format(stagecode, subcode))&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>alibabachallenge</category>
      <category>python</category>
      <category>micropython</category>
    </item>
    <item>
      <title>Call.md</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 22 May 2026 10:49:13 +0000</pubDate>
      <link>https://dev.to/quecpython/callmd-52lb</link>
      <guid>https://dev.to/quecpython/callmd-52lb</guid>
      <description>&lt;p&gt;&lt;strong&gt;## Overview&lt;/strong&gt;&lt;br&gt;
With the high-level API encapsulation of QuecPython modules, developers can quickly implement voice call functionality without delving into underlying protocols. In the REPL interactive environment, only one line of code is required to control the device to dial a specified mobile phone number, which significantly lowers the development threshold for IoT voice capabilities!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Core Advantages&lt;/strong&gt;&lt;br&gt;
Ultra-simple invocation: voiceCall.callStart("xxxxxxxxxxx") triggers a call directly with no complex configuration needed&lt;br&gt;
Instant verification: Real-time debugging in the REPL environment for quick validation of call functions&lt;br&gt;
Full-feature support: Comprehensive coverage of communication processes including dialing, answering, and hanging up calls&lt;br&gt;
Multi-network compatibility: Supports cellular networks such as 4G/CAT1 to ensure call quality&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Feature Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;### Making a Call&lt;/strong&gt;&lt;br&gt;
This method is used to actively initiate a phone call.&lt;/p&gt;

&lt;p&gt;voiceCall.callStart(phonenum)&lt;/p&gt;

&lt;p&gt;Get the complete project code with one click&lt;/p&gt;

&lt;p&gt;API reference&lt;/p&gt;

&lt;p&gt;voiceCall.callStart(phonenum)&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to voiceCall.callStart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Answering a Call&lt;/strong&gt;&lt;br&gt;
This method is used to answer an incoming phone call.&lt;/p&gt;

&lt;p&gt;voiceCall.callAnswer()&lt;/p&gt;

&lt;p&gt;Get the complete project code with one click&lt;/p&gt;

&lt;p&gt;API reference&lt;/p&gt;

&lt;p&gt;voiceCall.callAnswer()&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to voiceCall.callAnswer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Hanging Up a Call&lt;/strong&gt;&lt;br&gt;
This method is used to end an ongoing phone call.&lt;/p&gt;

&lt;p&gt;voiceCall.callEnd()&lt;/p&gt;

&lt;p&gt;Get the complete project code with one click.&lt;/p&gt;

&lt;p&gt;API reference&lt;/p&gt;

&lt;p&gt;voiceCall.callEnd()&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to voiceCall.callEnd.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Volume Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Getting Volume&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to retrieve the current call volume level.&lt;/p&gt;

&lt;p&gt;voiceCall.getVolume()&lt;/p&gt;

&lt;p&gt;Get the complete project code with one click.&lt;/p&gt;

&lt;p&gt;API reference&lt;/p&gt;

&lt;p&gt;voiceCall.getVolume()&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to voiceCall.getVolume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;### Setting Volume&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method is used to set the call volume level.&lt;/p&gt;

&lt;p&gt;voiceCall.setVolume(volume)&lt;/p&gt;

&lt;p&gt;Get the complete project code with one click.&lt;/p&gt;

&lt;p&gt;API reference&lt;/p&gt;

&lt;p&gt;voiceCall.setVolume(volume)&lt;/p&gt;

&lt;p&gt;For detailed API information, please refer to voiceCall.setVolume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Application Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Implement making and answering calls between QuecPython series development boards and mobile phones using the voiceCall feature.&lt;/p&gt;

&lt;p&gt;import voiceCall&lt;/p&gt;

&lt;p&gt;Make a call&lt;/p&gt;

&lt;p&gt;voiceCall.callStart("xxxxxxxxxxx")&lt;/p&gt;

&lt;p&gt;Hang up the call:&lt;/p&gt;

&lt;p&gt;voiceCall.callEnd()&lt;/p&gt;

&lt;p&gt;Answer a call&lt;/p&gt;

&lt;p&gt;voiceCall.callAnswer()&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Key Notes on Translation&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Maintained technical accuracy (e.g., "REPL" retained as the standard technical term, "CAT1" unchanged as a cellular network specification)&lt;/li&gt;
&lt;li&gt;Ensured natural expression of technical documentation (e.g., "一键获取完整项目代码" translated to "Get the complete project code with one click" for readability)&lt;/li&gt;
&lt;li&gt;Kept code block formatting consistent with the original&lt;/li&gt;
&lt;li&gt;Standardized terminology (e.g., "拨打电话 / 接听电话 / 挂断电话" translated to "Making a Call/Answering a Call/Hanging Up a Call" for consistency)&lt;/li&gt;
&lt;li&gt;Adjusted minor formatting (e.g., added code block markers for Python snippets) to conform to English technical documentation conventions while preserving the original content structure.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>iot</category>
      <category>embedded</category>
      <category>python</category>
      <category>micropython</category>
    </item>
    <item>
      <title>QuecPython + sms: SMS Functionality</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:35:41 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-sms-sms-functionality-58e5</link>
      <guid>https://dev.to/quecpython/quecpython-sms-sms-functionality-58e5</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With the encapsulation capability of QuecPython, developers can quickly implement SMS sending and receiving functions without dealing with complex AT commands. In the REPL interactive environment, SMS sending can be completed with just one line of code, making IoT communication development more efficient!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Advantages&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Minimalist Call: Send SMS directly with sms.sendTextMsg("xxxxxxxxxxx", "HelloQuecPython!")&lt;/li&gt;
&lt;li&gt;Instant Send and Test: Real-time execution in the REPL environment for quick verification of SMS functions&lt;/li&gt;
&lt;li&gt;Full Support: Easily implement SMS sending, receiving, deletion and other operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Function Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Send SMS&lt;/strong&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;TEXT Message&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to send TEXT type messages (empty SMS is not supported).&lt;/p&gt;

&lt;p&gt;sms.sendTextMsg(phoneNumber, msg, codeMode)&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.sendTextMsg.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;PDU Message&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to send PDU type messages (empty SMS is not supported).&lt;/p&gt;

&lt;p&gt;sms.sendPduMsg(phoneNumber, msg, codeMode)&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.sendPduMsg.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Delete SMS&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to delete the message at the specified index.&lt;/p&gt;

&lt;p&gt;sms.deleteMsg(index [, delmode])&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.deleteMsg.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Get SMS Quantity&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to get the number of SMS messages.&lt;/p&gt;

&lt;p&gt;sms.getMsgNums()&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.getMsgNums.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Get SMS Content&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;TEXT Mode&lt;/p&gt;

&lt;p&gt;This method is used to get SMS content in TEXT mode.&lt;/p&gt;

&lt;p&gt;sms.searchTextMsg(index)&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.searchTextMsg.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDU Mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method is used to get SMS content in PDU mode.&lt;/p&gt;

&lt;p&gt;sms.searchPduMsg(index)&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.searchPduMsg.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;SMS Decoding&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Length Decoding&lt;/p&gt;

&lt;p&gt;This method is used to get the length of the specified PDU SMS.&lt;/p&gt;

&lt;p&gt;sms.getPduLength(pduMsg)&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.getPduLength.&lt;/p&gt;

&lt;p&gt;Content Decoding&lt;/p&gt;

&lt;p&gt;This method is used for PDU decoding, which parses the PDU data read by the sms.searchPduMsg() interface.&lt;/p&gt;

&lt;p&gt;sms.decodePdu(pduMsg, pduLen)&lt;/p&gt;

&lt;p&gt;For API details, please refer to sms.decodePdu.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## Application Example&lt;/strong&gt;&lt;br&gt;
Use the SMS function of the QuecPython series development board to send and receive SMS with a mobile phone.&lt;/p&gt;

&lt;p&gt;import sms&lt;/p&gt;

&lt;p&gt;sms.deleteMsg(1,4) # Delete all SMS messages&lt;/p&gt;

&lt;h1&gt;
  
  
  Fill in the correct phone number
&lt;/h1&gt;

&lt;p&gt;sms.sendTextMsg('xxxxxxxxxxx', 'Hello, world.', 'GSM') # Send SMS to the mobile phone&lt;/p&gt;

&lt;h1&gt;
  
  
  Get SMS content in TEXT mode
&lt;/h1&gt;

&lt;p&gt;sms.searchTextMsg(0) # Receive SMS sent by the mobile phone&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzwn9ysqxh786621n8e7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzwn9ysqxh786621n8e7e.png" alt=" " width="621" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>sms</category>
    </item>
    <item>
      <title>QuecPython + GNSS: Implement Fast Positioning</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:32:32 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-gnss-implement-fast-positioning-12c1</link>
      <guid>https://dev.to/quecpython/quecpython-gnss-implement-fast-positioning-12c1</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;QuecPython, combined with a GNSS (Global Navigation Satellite System) module, provides an out-of-the-box positioning capability solution for IoT devices. This solution supports multi-constellation joint positioning including GPS, BeiDou, GLONASS and Galileo, and delivers a full-stack positioning solution from hardware access to cloud services for IoT developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Advantages and Features&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Multi-mode Positioning: Supports GNSS, LBS and Wi-Fi positioning functions&lt;br&gt;
Minimalist Development: Highly encapsulated API interfaces, no need to write underlying drivers&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Functional Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This article mainly describes how to use the built-in GNSS function of the QuecPython development board to obtain positioning information. The typical programming workflow is divided into the following parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GNSS Initialization&lt;/li&gt;
&lt;li&gt;Positioning Data Acquisition&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;GNSS Initialization&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to initialize the function of the module's built-in GNSS module.&lt;/p&gt;

&lt;p&gt;quecgnss.init()&lt;/p&gt;

&lt;p&gt;For API details, please refer to quecgnss.init.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Positioning Data Acquisition&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to read GNSS positioning data.&lt;/p&gt;

&lt;p&gt;quecgnss.read(size)&lt;/p&gt;

&lt;p&gt;For API details, please refer to quecgnss.read.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Parameter Configuration&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to set GNSS parameters, including satellite constellation, NMEA sentence type, whether to enable AGNSS and APFLASH, etc.&lt;/p&gt;

&lt;p&gt;quecgnss.configSet(config_type, config_value)&lt;/p&gt;

&lt;p&gt;For API details, please refer to quecgnss.configSet.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Sample Code&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;import quecgnss&lt;/p&gt;

&lt;h1&gt;
  
  
  Initialization
&lt;/h1&gt;

&lt;p&gt;quecgnss.init()&lt;/p&gt;

&lt;h1&gt;
  
  
  Read data
&lt;/h1&gt;

&lt;p&gt;data = quecgnss.read(4096)&lt;/p&gt;

&lt;h1&gt;
  
  
  Print data
&lt;/h1&gt;

&lt;p&gt;print(data[1].decode())&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Operation Result&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The following is an example of the operation result, which mainly introduces the content of the positioning data.&lt;/p&gt;

&lt;h1&gt;
  
  
  Operation Result
&lt;/h1&gt;

&lt;p&gt;167,169,170,,,,,,,,1.773,1.013,1.455*15&lt;/p&gt;

&lt;p&gt;$GPGSV,2,1,8,3,23,303,34,16,32,219,28,22,74,98,26,25,16,43,25*77&lt;/p&gt;

&lt;p&gt;$GPGSV,2,2,8,26,70,236,28,31,59,12,38,32,55,127,34,4,5,,21*49&lt;/p&gt;

&lt;p&gt;$BDGSV,2,1,8,163,51,192,32,166,70,11,31,167,52,197,32,169,59,334,31*61&lt;/p&gt;

&lt;p&gt;$BDGSV,2,2,8,170,40,205,31,161,5,,31,164,5,,27,165,5,,29*59&lt;/p&gt;

&lt;p&gt;$GNRMC,022326.000,A,3149.324624,N,11706.921702,E,0.000,261.541,180222,,E,A*38&lt;/p&gt;

&lt;p&gt;$GNGGA,022326.000,3149.324624,N,11706.921702,E,1,12,1.013,-8.580,M,0,M,,*47&lt;/p&gt;

&lt;p&gt;$GNGLL,3149.324624,N,11706.921702,E,022326.000,A,A*44&lt;/p&gt;

&lt;p&gt;$GNGSA,A,3,31,32,3,16,22,25,26,,,,,,1.773,1.013,1.455*1C&lt;/p&gt;

&lt;p&gt;$GNGSA,A,3,163,166,167,169,170,,,,,,,,1.773,1.013,1.455*15&lt;/p&gt;

&lt;p&gt;$GPGSV,2,1,8,3,23,303,34,16,32,219,27,22,74,98,26,25,16,43,25*78&lt;/p&gt;

&lt;p&gt;$GPGSV,2,2,8,26,70,236,28,31,59,12,37,32,55,127,34,4,5,,20*47&lt;/p&gt;

&lt;p&gt;$BDGSV,2,1,8,163,51,192,32,166,70,11,31,167,52,197,32,169,59,334,31*61&lt;/p&gt;

&lt;p&gt;$BDGSV,2,2,8,170,40,205,31,161,5,,31,164,5,,27,165,5,,29*59&lt;/p&gt;

&lt;p&gt;$GNRMC,022327.000,A,3149.324611,N,11706.921713,E,0.000,261.541,180222,,E,A*3F&lt;/p&gt;

&lt;p&gt;$GNGGA,022327.000,3149.324611,N,11706.921713,E,1,12,1.013,-8.577,M,0,M,,*48&lt;/p&gt;

&lt;p&gt;$GNGLL,3149.324611,N,11706.921713,E,022327.000,A,A*43&lt;/p&gt;

&lt;p&gt;...... # More data omitted&lt;/p&gt;

&lt;p&gt;$GNGSA,A,3,31,32,3,16,22,25,26,,,,,,1.837,1.120,1.456*11&lt;/p&gt;

&lt;p&gt;$GNGSA,A,3,163,166,167,169,170,,,,,,,,1.837,1.120,1.456*18&lt;/p&gt;

&lt;p&gt;$GPGSV,2,1,8,3,23,302,27,16,32,220,26,22,73,101,27,25,16,43,27*45&lt;/p&gt;

&lt;p&gt;$GPGSV,2,2,8,26,70,237,28,31,59,13,33,32,54,128,28,4,5,,24*44&lt;/p&gt;

&lt;p&gt;$BDGSV,2,1,8,163,51,192,33,166,71,11,35,167,52,198,33,169,59,334,34*6E&lt;/p&gt;

&lt;p&gt;$BDGSV,2,2,8,170,40,205,32,161,5,,33,164,5,,28,165,5,,30*5F&lt;/p&gt;

&lt;p&gt;$GNRMC,022507.000,A,3149.324768,N,11706.922344,E,0.000,261.541,180222,,E,A*31&lt;/p&gt;

&lt;p&gt;$GNGGA,022507.000,3149.324768,N,11706.922344,E,1,12,1.120,-8.794,M,0,M,,*48&lt;/p&gt;

&lt;p&gt;$GNGLL,3149.324768,N,11706.922344,E,022507.000,A,A*4D&lt;/p&gt;

&lt;p&gt;$GNGSA,A,3,31,32,3,16,22,25,26,,,,,,1.837,1.120,1.455*12&lt;/p&gt;

&lt;p&gt;$GNGSA,A,3,163,166,167,169,170,,,,,,,,1.837,1.120,1.455*1B&lt;/p&gt;

&lt;p&gt;$GPGSV,2,1,8,3,23,302,26,16,32,220,26,22,73,101,27,25,16,43,26*45&lt;/p&gt;

&lt;p&gt;$GPGSV,2,2,8,26,70,237,28,31,59,13,32,32,54,128,28,4,5,,24*45&lt;/p&gt;

&lt;p&gt;$BDGSV,2,1,8,163,51,192,24,166,71,11,35,167,52,198,33,169,59,334,34*68&lt;/p&gt;

&lt;p&gt;$BDGSV,2,2,8,170,40,205,31,161,5,,33,164,5,,28,165,5,,30*5C&lt;/p&gt;

&lt;p&gt;$GNRMC,022508.000,A,3149.324754,N,11706.922338,E,0.002,261.541,180222,,E,A*38&lt;/p&gt;

&lt;p&gt;$GNGGA,022508.000,3149.324754,N,11706.922338,E,1,12,1.120,-8.750,M,0,M,,*4B&lt;/p&gt;

&lt;p&gt;$GNGLL,3149.324754,N,11706.922338,E,022508.000,A,A*46&lt;/p&gt;

&lt;p&gt;$GNGSA,A,3,31,3&lt;/p&gt;

&lt;h1&gt;
  
  
  Data Introduction
&lt;/h1&gt;

&lt;p&gt;NMEA Port Data Classification:&lt;/p&gt;

&lt;p&gt;$GPGGA Global Positioning System Fix Data&lt;/p&gt;

&lt;p&gt;$GPGSA GNSS DOP and Active Satellites&lt;/p&gt;

&lt;p&gt;$GPGSV GNSS Satellites in View&lt;/p&gt;

&lt;p&gt;$GPRMC Recommended Minimum Specific GNSS Data&lt;/p&gt;

&lt;p&gt;$GPVTG Course Over Ground and Ground Speed&lt;/p&gt;

&lt;p&gt;$GPDTM Datum Reference&lt;/p&gt;

&lt;p&gt;$GPGNS GNSS Fix Data&lt;/p&gt;

&lt;p&gt;NMEA Sentence Parsing:&lt;/p&gt;

&lt;p&gt;Basic format of the GSV sentence:&lt;/p&gt;

&lt;p&gt;$GPGSV,(1),(2),(3),(4),(5),(6),(7),...,(4),(5),(6),(7)*hh(CR)(LF)&lt;/p&gt;

&lt;p&gt;Field 1: Total number of GSV sentences&lt;/p&gt;

&lt;p&gt;Field 2: Sequence number of this GSV sentence&lt;/p&gt;

&lt;p&gt;Field 3: Total number of visible satellites (00~12, leading 0 will be transmitted)&lt;/p&gt;

&lt;p&gt;Field 4: Satellite PRN number (01~32, leading 0 will be transmitted)&lt;/p&gt;

&lt;p&gt;Field 5: Satellite elevation (00~90 degrees, leading 0 will be transmitted)&lt;/p&gt;

&lt;p&gt;Field 6: Satellite azimuth (000~359 degrees, leading 0 will be transmitted)&lt;/p&gt;

&lt;p&gt;Field 7: Signal-to-Noise Ratio (00~99dB, empty when no satellite is tracked) (commonly known as CN value)&lt;/p&gt;

&lt;p&gt;Basic format of the GGA sentence:&lt;/p&gt;

&lt;p&gt;$GPGGA,(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12)*hh(CR)(LF)&lt;/p&gt;

&lt;p&gt;Field 1: UTC time, in hhmmss.sss format (hours, minutes and seconds)&lt;/p&gt;

&lt;p&gt;Field 2: Latitude, in ddmm.mmmm format (degrees and minutes, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 3: Latitude hemisphere, N (North) or S (South)&lt;/p&gt;

&lt;p&gt;Field 4: Longitude, in dddmm.mmmm format (degrees and minutes, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 5: Longitude hemisphere, E (East) or W (West)&lt;/p&gt;

&lt;p&gt;Field 6: GPS status, 0=No fix, 1=Non-differential fix, 2=Differential fix, 3=Invalid PPS, 6=Estimating&lt;/p&gt;

&lt;p&gt;Field 7: Number of satellites in use (00 - 12, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 8: HDOP (Horizontal Dilution of Precision) (0.5 - 99.9)&lt;/p&gt;

&lt;p&gt;Field 9: Altitude above mean sea level (-9999.9 - 99999.9)&lt;/p&gt;

&lt;p&gt;Field 10: Unit of altitude, meters&lt;/p&gt;

&lt;p&gt;Field 11: Geoidal separation (Height of the geoid above the WGS84 ellipsoid)&lt;/p&gt;

&lt;p&gt;Field 12: Unit of geoidal separation, meters&lt;/p&gt;

&lt;p&gt;Basic format of the GSA sentence:&lt;/p&gt;

&lt;p&gt;$GPGSA,(1),(2),(3),(3),,,,,,,,,,(3),(4),(5),(6),(7)*hh(CR)(LF)&lt;/p&gt;

&lt;p&gt;Field 1: Positioning mode, A=Automatic 2D/3D, M=Manual 2D/3D&lt;/p&gt;

&lt;p&gt;Field 2: Fix type, 1=No fix, 2=2D fix, 3=3D fix&lt;/p&gt;

&lt;p&gt;Field 3: PRN (Pseudo Random Noise) code of the satellite in use (up to 12 entries, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 4: PDOP (Position Dilution of Precision) (0.0 - 500.0)&lt;/p&gt;

&lt;p&gt;Field 5: HDOP (Horizontal Dilution of Precision) (0.0 - 500.0)&lt;/p&gt;

&lt;p&gt;Field 6: VDOP (Vertical Dilution of Precision) (0.0 - 500.0)&lt;/p&gt;

&lt;p&gt;Field 7: Satellite system ID&lt;/p&gt;

&lt;p&gt;Basic format of the VTG sentence:&lt;/p&gt;

&lt;p&gt;$GPVTG,(1),(2),(3),(4),(5),(6),(7),(8),(9)*hh(CR)(LF)&lt;/p&gt;

&lt;p&gt;Field 1: Course over ground (000 - 359 degrees, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 2: T=True north reference&lt;/p&gt;

&lt;p&gt;Field 3: Course over ground (000 - 359 degrees, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 4: M=Magnetic north reference&lt;/p&gt;

&lt;p&gt;Field 5: Ground speed (0.00, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 6: N=Knots&lt;/p&gt;

&lt;p&gt;Field 7: Ground speed (0.00, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 8: K=Kilometers per hour (km/h)&lt;/p&gt;

&lt;p&gt;Field 9: Status indicator, E(Dead reckoning), A(Non-DGPS fix)&lt;/p&gt;

&lt;p&gt;Basic format of the RMC sentence:&lt;/p&gt;

&lt;p&gt;$GPRMC,(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13)*hh(CR)(LF)&lt;/p&gt;

&lt;p&gt;Field 1: UTC time, in hhmmss.sss format&lt;/p&gt;

&lt;p&gt;Field 2: Status, A=Valid fix, V=Invalid fix&lt;/p&gt;

&lt;p&gt;Field 3: Latitude, in ddmm.mmmm format (padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 4: Latitude hemisphere, N (North) or S (South)&lt;/p&gt;

&lt;p&gt;Field 5: Longitude, in dddmm.mmmm format (padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 6: Longitude hemisphere, E (East) or W (West)&lt;/p&gt;

&lt;p&gt;Field 7: Speed over ground, in Knots&lt;/p&gt;

&lt;p&gt;Field 8: Course over ground, in degrees&lt;/p&gt;

&lt;p&gt;Field 9: UTC date, in DDMMYY format&lt;/p&gt;

&lt;p&gt;Field 10: Magnetic variation (000 - 180 degrees, padded with 0 if leading digits are insufficient)&lt;/p&gt;

&lt;p&gt;Field 11: Magnetic variation direction, E=East, W=West&lt;/p&gt;

&lt;p&gt;Field 12: Status indicator, E(Dead reckoning), A(Non-DGPS fix)&lt;/p&gt;

&lt;p&gt;Field 13: Navigation status, V=Navigation status not available&lt;/p&gt;

&lt;p&gt;Basic format of the DTM sentence:&lt;/p&gt;

&lt;p&gt;$GNDTM,&amp;lt;1&amp;gt;,&amp;lt;2&amp;gt;,&amp;lt;3&amp;gt;,&amp;lt;4&amp;gt;,&amp;lt;5&amp;gt;,&amp;lt;6&amp;gt;,&amp;lt;7&amp;gt;,&amp;lt;8&amp;gt;*&amp;lt;9&amp;gt;(CR)(LF)&lt;/p&gt;

&lt;p&gt;&amp;lt;1&amp;gt; Local datum code (e.g. W84, P90)&lt;/p&gt;

&lt;p&gt;&amp;lt;2&amp;gt; Datum subcode (empty)&lt;/p&gt;

&lt;p&gt;&amp;lt;3&amp;gt; Latitude offset&lt;/p&gt;

&lt;p&gt;&amp;lt;4&amp;gt; Latitude hemisphere, N (North) or S (South)&lt;/p&gt;

&lt;p&gt;&amp;lt;5&amp;gt; Longitude offset&lt;/p&gt;

&lt;p&gt;&amp;lt;6&amp;gt; Longitude hemisphere, E (East) or W (West)&lt;/p&gt;

&lt;p&gt;&amp;lt;7&amp;gt; Altitude offset&lt;/p&gt;

&lt;p&gt;&amp;lt;8&amp;gt; Reference datum code (W84)&lt;/p&gt;

&lt;p&gt;&amp;lt;9&amp;gt; Checksum&lt;/p&gt;

&lt;p&gt;Basic format of the GNS sentence:&lt;/p&gt;

&lt;p&gt;$GNGNS,&amp;lt;1&amp;gt;,&amp;lt;2&amp;gt;,&amp;lt;3&amp;gt;,&amp;lt;4&amp;gt;,&amp;lt;5&amp;gt;,&amp;lt;6&amp;gt;,&amp;lt;7&amp;gt;,&amp;lt;8&amp;gt;.&amp;lt;9&amp;gt;,&amp;lt;10&amp;gt;,&amp;lt;11&amp;gt;,&amp;lt;12&amp;gt;,&amp;lt;13&amp;gt;,*&amp;lt;14&amp;gt;(CR)(LF)&lt;/p&gt;

&lt;p&gt;&amp;lt;1&amp;gt; UTC time: Fix time in hhmmss.ss format (000000.00~235959.99)&lt;/p&gt;

&lt;p&gt;&amp;lt;2&amp;gt; Latitude: in ddmm.mmmmm format (0000.00000~8959.9999)&lt;/p&gt;

&lt;p&gt;&amp;lt;3&amp;gt; Latitude hemisphere: N for North, S for South&lt;/p&gt;

&lt;p&gt;&amp;lt;4&amp;gt; Longitude: in dddmm.mmmmm format (0000.00000~17959.99999)&lt;/p&gt;

&lt;p&gt;&amp;lt;5&amp;gt; Longitude hemisphere: E for East, W for West&lt;/p&gt;

&lt;p&gt;&amp;lt;6&amp;gt; Positioning mode: N=No fix; A=Autonomous fix; D=Differential fix; P=Precise point positioning; R=RTK fixed; F=RTK float; E=Estimated; M=Manual input; S=Simulated&lt;/p&gt;

&lt;p&gt;&amp;lt;7&amp;gt; Number of satellites used in positioning (00-99)&lt;/p&gt;

&lt;p&gt;&amp;lt;8&amp;gt; HDOP (Horizontal Dilution of Precision) (0.5-99.9)&lt;/p&gt;

&lt;p&gt;&amp;lt;9&amp;gt; Altitude above mean sea level, unit: meters&lt;/p&gt;

&lt;p&gt;&amp;lt;10&amp;gt; Geoidal separation: Height of the geoid above the WGS84 ellipsoid&lt;/p&gt;

&lt;p&gt;&amp;lt;11&amp;gt; Age of differential data: Empty for GN-prefixed sentences&lt;/p&gt;

&lt;p&gt;&amp;lt;12&amp;gt; Base station ID: Empty for GN-prefixed sentences&lt;/p&gt;

&lt;p&gt;&amp;lt;13&amp;gt; Navigation status: C=Caution, S=Safe, U=Unsafe, V=Invalid&lt;/p&gt;

&lt;p&gt;&amp;lt;14&amp;gt; Checksum&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>gnss</category>
    </item>
    <item>
      <title>QuecPython + audio: Implement Audio Recording and Playback</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:29:57 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-audio-implement-audio-recording-and-playback-2a6e</link>
      <guid>https://dev.to/quecpython/quecpython-audio-implement-audio-recording-and-playback-2a6e</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;As a development framework designed specifically for the Internet of Things, QuecPython provides complete audio processing capabilities for embedded devices through highly encapsulated Python interfaces. This article mainly describes how to quickly implement audio function development with QuecPython.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Advantages&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;• Minimalist Development: Complete basic audio recording and playback with just 3 lines of code.&lt;/p&gt;

&lt;p&gt;• Quick Start: Get started rapidly without professional audio knowledge.&lt;/p&gt;

&lt;p&gt;• Complete Documentation: Supported by full technical documentation and sample code.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Main Functions&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;TTS - Text to Speech Playback&lt;/strong&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Create TTS Object&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;class audio.TTS(device)&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to audio.TTS.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Speech Playback&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to start speech playback.&lt;/p&gt;

&lt;p&gt;TTS.play(priority, breakin, mode, str)&lt;/p&gt;

&lt;p&gt;For API details, please refer to TTS.play.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Volume Setting&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to set the playback volume. The volume value must be in the range [0 ~ 9], where 0 means mute.&lt;/p&gt;

&lt;p&gt;TTS.setVolume(vol)&lt;/p&gt;

&lt;p&gt;For API details, please refer to TTS.setVolume.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Playback Speed Setting&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to set the TTS playback speed. The speed value must be in the range [0 ~ 9].&lt;/p&gt;

&lt;p&gt;TTS.setSpeed(speed)&lt;/p&gt;

&lt;p&gt;For API details, please refer to TTS.setSpeed.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Sample Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;import audio tts = audio.TTS(1) # Case: Task A is playing and allows interruption. When Task B with a higher priority arrives, Task A will be interrupted and Task B will be played directly tts.play(1, 1, 2, '111')  # Task A tts.play(2, 0, 2, '222')  # Task B&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Audio - Audio Playback&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Create Audio Object&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;class audio.Audio(device)&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to audio.Audio.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Set PA Pin&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to configure the GPIO of the output PA. Refer to the schematic of the corresponding development board to set the PA pin, so that the SPK interface of the development board can output sound.&lt;/p&gt;

&lt;p&gt;Audio.set_pa(gpio,num)&lt;/p&gt;

&lt;p&gt;For API details, please refer to Audio.set_pa.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Audio Playback&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to play audio files, supporting playback of files in mp3, amr and wav formats.&lt;/p&gt;

&lt;p&gt;Audio.play(priority, breakin, filename)&lt;/p&gt;

&lt;p&gt;For API details, please refer to Audio.play.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Volume Setting&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to set the playback volume. The volume value must be in the range [0 ~ 11], where 0 means mute.&lt;/p&gt;

&lt;p&gt;Audio.setVolume(vol)&lt;/p&gt;

&lt;p&gt;For API details, please refer to Audio.setVolume.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Audio Stream Playback&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used for audio stream playback, supporting playback of audio streams in mp3, amr and wav formats.&lt;/p&gt;

&lt;p&gt;Audio.playStream(format, buf)&lt;/p&gt;

&lt;p&gt;For API details, please refer to Audio.playStream.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Sample Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;import audio from machine import Pin aud = audio.Audio(0) # Set PA pin aud.set_pa(Pin.GPIO15,2) # Play MP3 file aud.play(2, 1, 'U:/music.mp3')&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Record - Audio Recording&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Create Record Object&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;class audio.Record(device)&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to audio.Record.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Start Recording&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to start audio recording.&lt;/p&gt;

&lt;p&gt;Record.start(file_name,seconds)&lt;/p&gt;

&lt;p&gt;For API details, please refer to Record.start.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Audio Stream Recording&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to start audio stream recording.&lt;/p&gt;

&lt;p&gt;Note: While recording the audio stream, you must read the audio stream in a timely manner. A circular buffer is currently used, and failure to read in time will result in data loss.&lt;/p&gt;

&lt;p&gt;Record.stream_start(format, samplerate, time)&lt;/p&gt;

&lt;p&gt;For API details, please refer to Record.stream_start.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Sample Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;import audio record = audio.Record() record.start('recordfile.wav', 10)&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>audio</category>
    </item>
    <item>
      <title>QuecPython + camera: Implement QR Code/Barcode Scanning and Photo Capture</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:22:56 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-camera-implement-qr-codebarcode-scanning-and-photo-capture-45bf</link>
      <guid>https://dev.to/quecpython/quecpython-camera-implement-qr-codebarcode-scanning-and-photo-capture-45bf</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With a QuecPython development board paired with a camera module, developers can easily implement code scanning (QR code/barcode recognition) and photo capture functions, which are applicable to scenarios such as smart access control, industrial inspection, and mobile payment.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Features&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Minimalist Development Experience: No need to write underlying drivers, complete photo capture with just 3 lines of code.&lt;/p&gt;

&lt;p&gt;Plug and Play: Supports common camera modules (such as GC032A).&lt;/p&gt;

&lt;p&gt;Cross-platform Compatibility: Code can be ported to other QuecPython development boards that support camera functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Working Mode&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Note: The LCD must be initialized before using the camera function.&lt;/p&gt;

&lt;p&gt;For the LCD initialization program, please refer to: &lt;a href="https://github.com/QuecPython/QuecPython_lib_bundles/tree/master/libraries/LCD" rel="noopener noreferrer"&gt;https://github.com/QuecPython/QuecPython_lib_bundles/tree/master/libraries/LCD&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Camera Preview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create Camera Preview Object&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwrsmzbfbc3yu891t9v7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwrsmzbfbc3yu891t9v7.png" alt=" " width="626" height="28"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to camera.camPreview.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Enable Camera Preview Function&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to turn on the preview function of the camera.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4hd7rn3pft3pqsgvl0p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4hd7rn3pft3pqsgvl0p.png" alt=" " width="631" height="38"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Disable Camera Preview Function&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to turn off the preview function of the camera.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjghst3nmqjbwqij7opp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjghst3nmqjbwqij7opp.png" alt=" " width="616" height="38"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For API details, please refer to camPreview.close.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Sample Code&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftdkl4qcmt4captxvhk94.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftdkl4qcmt4captxvhk94.png" alt=" " width="749" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Camera Code Scanning&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create Camera Code Scanning Object&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F926vng6cgg7rf5tcinsm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F926vng6cgg7rf5tcinsm.png" alt=" " width="611" height="58"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to camera.camScandecode.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Enable Camera Code Scanning Function&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to enable the code scanning function of the camera.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frlk9wtlrrlf7iwnys9np.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frlk9wtlrrlf7iwnys9np.png" alt=" " width="601" height="38"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For API details, please refer to camScandecode.start.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Sample Code&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9uu5j3uuwgue2o8d7my.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9uu5j3uuwgue2o8d7my.png" alt=" " width="630" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi46l6032dlkiup2w2b6k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi46l6032dlkiup2w2b6k.png" alt=" " width="628" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Camera Photo Capture&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Create Camera Photo Capture Object&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbf0xycb41w8waf8hvhr2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbf0xycb41w8waf8hvhr2.png" alt=" " width="747" height="53"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to camera.camCapture.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Enable Camera Photo Capture Function&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to enable the photo capture function of the camera.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05t6qrpmfpfm19nrif2l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05t6qrpmfpfm19nrif2l.png" alt=" " width="751" height="50"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Start Photo Capture&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to start photo capture and save the image file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpgbf6i0ddfkcts9fxb4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpgbf6i0ddfkcts9fxb4w.png" alt=" " width="759" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: There is a typo camCapture in the original text, the standard API name is camCapture.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Sample Code&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xrl14izy6jt5iuovt9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xrl14izy6jt5iuovt9w.png" alt=" " width="747" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsoclo3l0781rxab8bs6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsoclo3l0781rxab8bs6.png" alt=" " width="756" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>qrcode</category>
      <category>barcode</category>
    </item>
    <item>
      <title>QuecPython + USBNET: Implement USB Network Adapter Functionality</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:14:42 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-usbnet-implement-usb-network-adapter-functionality-1ocb</link>
      <guid>https://dev.to/quecpython/quecpython-usbnet-implement-usb-network-adapter-functionality-1ocb</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;USBNET Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;USBNET (USB Networking) is a technology that enables network communication via a USB interface. It allows devices to emulate Ethernet over a USB connection (Ethernet over USB) or directly transmit network data through USB links. It is widely used in scenarios such as embedded devices, industrial control, virtual machines, and portable devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Features of USBNET&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;USB Interface Based: Implements network communication using the USB physical layer, eliminating the need for traditional network cables (such as RJ45).&lt;/p&gt;

&lt;p&gt;High-Speed Transmission: Supports USB 2.0 (480 Mbps), USB 3.0 (5 Gbps), and even USB4 (40 Gbps).&lt;/p&gt;

&lt;p&gt;Low Latency: Delivers lower latency than wireless networks (Wi-Fi), making it suitable for real-time data transmission.&lt;/p&gt;

&lt;p&gt;Plug and Play: Supports hot swapping, with automatic device recognition and network configuration upon connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Common Working Types of USBNET&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;ECM Mode (Ethernet Control Model)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Protocol: Standard USB protocol with strong compatibility (natively supported by Linux/Android/macOS).&lt;/p&gt;

&lt;p&gt;Applicable Scenarios: Embedded Linux devices, industrial controllers.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;RNDIS Mode (Remote NDIS)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Protocol: Microsoft-led USB network protocol, natively supported by Windows by default.&lt;/p&gt;

&lt;p&gt;Applicable Scenarios: Windows device debugging (e.g., Android USB network tethering).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;NCM Mode (Network Control Model)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Protocol: USB-IF standard protocol, more efficient than ECM.&lt;/p&gt;

&lt;p&gt;Applicable Scenarios: 5G modules, high-performance embedded devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Functional Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This article mainly describes how to implement the USBNET function with a QuecPython development board and provide network access for connected devices. The typical programming workflow is divided into the following parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Import the USBNET package&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set the working type of the USB network adapter&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable the USB network adapter&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Import the USBNET Package&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;First, import the USBNET package from misc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkcfl7a41h9dwr3kflx31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkcfl7a41h9dwr3kflx31.png" alt=" " width="741" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Set the Working Type&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to set the working type of the USB network adapter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fly0tvwvm05skhatkzfjz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fly0tvwvm05skhatkzfjz.png" alt=" " width="737" height="46"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For API details, please refer to USBNET.set_worktype.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Enable the USB Network Adapter&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This method is used to turn on the USB network adapter function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few4sd637hkrftfgv6w0s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few4sd637hkrftfgv6w0s.png" alt=" " width="745" height="43"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For API details, please refer to USBNET.open.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Application Example&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Taking the EC600MCNLE QuecPython development board as an example, this example creates a USB network adapter to provide network access for a PC. The sample code is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpazmhguphkbq6psqh17j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpazmhguphkbq6psqh17j.png" alt=" " width="643" height="651"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After entering the above code via QPYcom, the USB network adapter is enabled. When you check the network connection interface on the PC, you will see an additional available network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ry7fccklrbfnjinyy4k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ry7fccklrbfnjinyy4k.png" alt=" " width="650" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open Command Prompt (cmd) and enter ipconfig, you can see that the basic network information has been obtained. At this point, if you disable all other network interfaces and only keep the USB network adapter interface, the computer can still access the Internet normally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihl2zfylnicah7wgujxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihl2zfylnicah7wgujxv.png" alt=" " width="618" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can then access web pages through your computer's browser. For example, enter &lt;a href="https://python.quectel.com" rel="noopener noreferrer"&gt;https://python.quectel.com&lt;/a&gt; in the browser address bar to access the site normally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4oddtpf7rflk3artxi0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4oddtpf7rflk3artxi0.png" alt=" " width="604" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>iot</category>
      <category>usb</category>
    </item>
    <item>
      <title>QuecPython + WLAN: Wireless Network Control</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:07:54 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-wlan-wireless-network-control-b5h</link>
      <guid>https://dev.to/quecpython/quecpython-wlan-wireless-network-control-b5h</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;WLAN Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;WLAN (Wireless Local Area Network) is a network technology that enables interconnection between devices through wireless signals (such as Wi-Fi). It allows computers, smartphones, IoT devices and other terminals to access a local area network or the Internet without using physical cables.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Core Features of WLAN&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;• Wireless Transmission: Uses radio waves (2.4GHz/5GHz/6GHz frequency bands) instead of network cables, supporting device mobility.&lt;/p&gt;

&lt;p&gt;• Standardized Protocols: Based on the IEEE 802.11 series of standards (such as 802.11ac, 802.11ax).&lt;/p&gt;

&lt;p&gt;• Flexible Deployment: No wiring required, suitable for scenarios including homes, enterprises, and public places.&lt;/p&gt;

&lt;p&gt;• Shared Bandwidth: All devices share the same wireless channel, and the available bandwidth is affected by the access point (AP) and environmental interference.&lt;/p&gt;

&lt;p&gt;• Security Mechanisms: Supports WPA3 and WPA2 encryption to prevent unauthorized access.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Functional Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This article mainly describes how to use the QuecPython development board to connect to a Wi-Fi hotspot and create a Wi-Fi hotspot. The typical programming workflow is divided into the following parts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Station Mode: Connect to a Wi-Fi hotspot&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a Wi-Fi network interface object&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect to the target hotspot&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;AP Mode: Create a Wi-Fi hotspot&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a Wi-Fi network interface object&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set the hotspot name and password&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Activate the network interface&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Station Mode&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Create a Wi-Fi Network Interface Object&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Initialize the Wi-Fi network interface information and return the Wi-Fi network interface object.&lt;/p&gt;

&lt;p&gt;class network.WLAN(mode)&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to the constructor.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Connect to a Hotspot&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to connect to the specified wireless network. It only supports Station mode, and supports both blocking and non-blocking connection modes, with a default blocking connection and a 15s timeout period.&lt;/p&gt;

&lt;p&gt;If the ssid and password are not specified, the device will automatically connect to the last successfully connected AP.&lt;/p&gt;

&lt;p&gt;WLAN.connect([ssid, password, bssid, timeout])&lt;/p&gt;

&lt;p&gt;For API details, please refer to WLAN.connect.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;AP Mode&lt;/strong&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Create a Wi-Fi Network Interface Object&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Initialize the Wi-Fi network interface information and return the Wi-Fi network interface object.&lt;/p&gt;

&lt;p&gt;class network.WLAN(mode)&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to the constructor.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Set Configuration Parameters&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to set the name and password of the hotspot.&lt;/p&gt;

&lt;p&gt;WLAN.config(ap_ssid = "SSID", ap_password = "PASSWD")&lt;/p&gt;

&lt;p&gt;For API details, please refer to WLAN.config.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Activate the Network Interface&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This method is used to activate the network interface and trigger the startup of the hotspot.&lt;/p&gt;

&lt;p&gt;WLAN.active(enable)&lt;/p&gt;

&lt;p&gt;For API details, please refer to WLAN.active.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Application Example&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This example uses the FCM360W QuecPython development board to connect to a hotspot, the sample code is as follows:&lt;/p&gt;

&lt;p&gt;import network&lt;/p&gt;

&lt;p&gt;Create a Wi-Fi network interface and set it to STATION modenic = network.WLAN(network.STA_MODE)&lt;/p&gt;

&lt;p&gt;Define Wi-Fi event callback functiondef wifi_event_cb(event):&lt;/p&gt;

&lt;p&gt;Print event informationprint("- Event:\r\n ", event)&lt;/p&gt;

&lt;p&gt;When the IP address is obtained, print IP address related informationif event['id'] == 3305:print("- Got IP:\r\n ", nic.ifconfig())&lt;/p&gt;

&lt;p&gt;Set the event callback&lt;br&gt;
 functionnic.config(event_callback = wifi_event_cb)&lt;/p&gt;

&lt;p&gt;Connect to the hotspotnic.connect(ssid = "QuecPython", password = "12345678")&lt;/p&gt;

&lt;p&gt;The code execution result is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Connecting to QuecPython &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Event:    {'msg': None, 'type': 3300, 'id': 3301} &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Event:    {'msg': {'password': '12345678', 'ssid': 'QuecPython', 'rssi': -62, 'channel': 1, 'bssid': 'a4:00:e2:ef:f7:80', 'auth': 4, 'cipher': 4}, 'type': 3300, 'id': 3302} &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Event:    {'msg': ('10.66.117.73', '255.255.252.0', '10.66.116.1', '0.0.0.0', '0.0.0.0'), 'type': 3300, 'id': 3305} &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Got IP:    ('10.66.117.73', '255.255.252.0', '10.66.116.1', '211.138.180.2', '114.114.114.114')&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>iot</category>
      <category>wlan</category>
    </item>
    <item>
      <title>QuecPython + 1-Wire: IoT Device Communication Guide + Application Examples</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:02:30 +0000</pubDate>
      <link>https://dev.to/quecpython/quecpython-1-wire-iot-device-communication-guide-application-examples-53a7</link>
      <guid>https://dev.to/quecpython/quecpython-1-wire-iot-device-communication-guide-application-examples-53a7</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;1-Wire Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;1-Wire is a master-slave serial communication protocol developed by Dallas Semiconductor (USA), primarily designed to enable communication between microcontrollers and 1-Wire devices. Unlike SPI and I2C serial data communication methods, 1-Wire uses a single signal line to achieve bidirectional data transmission. This design greatly simplifies hardware connections and reduces system cost and complexity.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction to 1-Wire Communication Timing&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The basic time slots of 1-Wire are divided into three phases: initialization, write 0 &amp;amp; 1, and read 0 &amp;amp; 1(this article uses the time slots of the DS18B20 temperature sensor as an example).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Initialization&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjo7dbj1xi7obntrj2bes.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjo7dbj1xi7obntrj2bes.png" alt=" " width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All communication with the DS18B20 starts with an initialization sequence, which consists of a reset pulse issued by the host, followed by a presence pulse sent by the DS18B20. When the DS18B20 responds to the reset and sends a presence pulse, it signals to the host that it is connected to the bus and ready for operation.&lt;/p&gt;

&lt;p&gt;Specific Process: The bus master transmits (TX) a reset pulse by pulling the 1-Wire bus low for a minimum of 480μs. The bus master then releases the bus and enters receive mode (RX). After the bus is released, the pull-up resistor pulls the 1-Wire bus high. When the DS18B20 detects this rising edge, it waits 15μs to 60μs, then sends a presence pulse by pulling the 1-Wire bus low for 60μs to 240μs.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Write 0 &amp;amp; 1&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3mrqpgwp9bwpva3dz9b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv3mrqpgwp9bwpva3dz9b.png" alt=" " width="800" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All write time slots must have a minimum duration of 60μs, with a minimum recovery time of 1μs between each write slot. Both types of write slots are initiated by the host pulling the 1-Wire bus low.&lt;/p&gt;

&lt;p&gt;Write 0: To generate a "write 0" slot, after pulling the 1-Wire bus low, the bus master must continue to hold the bus low for the entire duration of the slot (a minimum of 60μs).&lt;/p&gt;

&lt;p&gt;Write 1: To generate a "write 1" slot, after pulling the 1-Wire bus low, the bus master must release the 1-Wire bus within 15μs. After the bus is released, the pull-up resistor pulls the bus high.&lt;/p&gt;

&lt;p&gt;Specific Process: The DS18B20 samples the 1-Wire bus within a 15μs to 60μs window after the host initiates the write slot. If the bus is high during the sampling window, a 1 is written to the DS18B20. If the bus is low, a 0 is written to the DS18B20.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Read 0 &amp;amp; 1&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtge3f80439wazd1mxl7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtge3f80439wazd1mxl7.png" alt=" " width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All read time slots must have a minimum duration of 60μs, with a minimum recovery time of 1μs between slots. A read slot is initiated by the host pulling the 1-Wire bus low for a minimum of 1μs and then releasing the bus. After the host initiates the read slot, the DS18B20 will start transmitting 1 or 0 on the bus. The DS18B20 can only send data to the host when the host issues a read slot.&lt;/p&gt;

&lt;p&gt;Read 0: The DS18B20 will release the bus at the end of the read slot, and the bus will be pulled back to the high-level idle state by the pull-up resistor.&lt;/p&gt;

&lt;p&gt;Read 1: The DS18B20 keeps the bus at a high level.&lt;/p&gt;

&lt;p&gt;Specific Process: The output data from the DS18B20 is valid within 15μs after the falling edge that initiates the read slot. Therefore, the host must release the bus and then sample the bus status within 15μs after the start of the slot.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Functional Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This section mainly describes how to use the functions and data types of the 1-Wire driver to establish communication between QuecPython series modules and the DS18B20 sensor. The typical programming workflow is divided into the following parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Object Creation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reset&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Transmission&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Reading&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Object Creation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When creating a 1-Wire object, you need to set the GPIO connected to the DQ pin.&lt;/p&gt;

&lt;p&gt;class machine.OneWire(GPIO)&lt;/p&gt;

&lt;p&gt;For parameter details, please refer to the constructor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reset&lt;/strong&gt;&lt;br&gt;
This method is used to reset the bus and detect whether the device responds. This interface must be called first before calling the read and write interfaces.&lt;/p&gt;

&lt;p&gt;OneWire.reset()&lt;/p&gt;

&lt;p&gt;For API details, please refer to machine.OneWire.reset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Transmission&lt;/strong&gt;&lt;br&gt;
This method is used for the host to write data to the slave, and the data to be written is of bytes type.&lt;/p&gt;

&lt;p&gt;OneWire.write(data)&lt;/p&gt;

&lt;p&gt;For API details, please refer to machine.OneWire.write.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Reading&lt;/strong&gt;&lt;br&gt;
The data read by this method is the raw data of the DS18B20, which needs to be converted into the actual temperature according to the data format of the DS18B20.&lt;/p&gt;

&lt;p&gt;OneWire.read(len)&lt;/p&gt;

&lt;p&gt;For API details, please refer to machine.OneWire.read.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Application Example: DS18B20 Temperature Sensor&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The DS18B20 is a widely used digital temperature sensor produced by Dallas Semiconductor. It internally integrates modules including a temperature sensor, temperature conversion circuit, non-volatile memory, configuration register, and 1-Wire interface circuit. Through the 1-Wire interface circuit, the DS18B20 communicates with the external host to realize data transmission and command reception.&lt;/p&gt;

&lt;p&gt;Basic Commands:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F119egdm8xldbnjwyikwm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F119egdm8xldbnjwyikwm.png" alt=" " width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CCh: Skip ROM (when only one DS18B20 sensor is connected, 0xCC can be sent to skip ROM matching)&lt;/li&gt;
&lt;li&gt;44h: Start temperature conversion&lt;/li&gt;
&lt;li&gt;4Eh: Write scratchpad register&lt;/li&gt;
&lt;li&gt;BEh: Read scratchpad register (a total of 9 registers can be read, the first 2 are temperature values)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fosxgjyni0mp0buh4ocg5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fosxgjyni0mp0buh4ocg5.png" alt=" " width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The temperature value obtained by the DS18B20 is in the following format and requires conversion:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62f4h8l9i11ee8jde7sn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62f4h8l9i11ee8jde7sn.png" alt=" " width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Complete Communication Flow&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reset and initialization&lt;/li&gt;
&lt;li&gt; Host sends [0xcc, 0x44] to start DS18B20 temperature conversion&lt;/li&gt;
&lt;li&gt;Reset again&lt;/li&gt;
&lt;li&gt;Host sends [0xcc, 0xbe] to read the temperature value from the scratchpad register&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Sample Code for Obtaining DS18B20 Temperature Value&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhlefitvpbe4j8c89euq4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhlefitvpbe4j8c89euq4.png" alt=" " width="722" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;FAQ&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Reset Initialization Failure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This may be caused by a hardware connection issue. Check the hardware connections to ensure that the GPIO used to create the object is consistent with the pin on the development board connected to the DQ pin of the DS18B20, and that the ground (GND) is also correctly connected. The DS18B20 sensor is damaged, resulting in communication failure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Normal Transceiving but Erroneous Data&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This may be caused by an inconsistent level between the host GPIO and the slave DQ pin. For example, if the host level is 3.3V and the slave level is 1.8V, the high level of the slaveis 1.8V. The host generally recognizes a level higher than 1.65V as high level, which is prone to misjudgment.&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>1wire</category>
      <category>iot</category>
    </item>
    <item>
      <title>VSCode Plugin User Guide</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 24 Apr 2026 11:53:06 +0000</pubDate>
      <link>https://dev.to/quecpython/vscode-plugin-user-guide-56j3</link>
      <guid>https://dev.to/quecpython/vscode-plugin-user-guide-56j3</guid>
      <description>&lt;p&gt;To facilitate developers using VSCode for QuecPython development, the QuecPython team has introduced a VSCode plugin called QuecPython.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo20i7r5w4eb7kcv8klv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo20i7r5w4eb7kcv8klv.png" alt=" " width="713" height="388"&gt;&lt;/a&gt;&lt;br&gt;
The plugin currently supports the following features:&lt;/p&gt;

&lt;p&gt;• Firmware flashing&lt;/p&gt;

&lt;p&gt;• REPL command interaction&lt;/p&gt;

&lt;p&gt;• File transfer&lt;/p&gt;

&lt;p&gt;• Filesystem directory tree&lt;/p&gt;

&lt;p&gt;• Run specific script files&lt;/p&gt;

&lt;p&gt;It currently all QuecPython series modules.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Plugin Installation&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click on the Extensions icon in the primary sidebar .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type QuecPython in the plugin search box.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find the QuecPython plugin in the search list, click the install button to complete the plugin installation.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6zyxc0dwv8e1di6mgndv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6zyxc0dwv8e1di6mgndv.png" alt=" " width="717" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Plugin Usage Guide&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before you start, make sure you have downloaded the appropriate QuecPython firmware package for your module. Click here to view how to download firmware packages.&lt;/p&gt;

&lt;p&gt;The following steps are demonstrated based on the U-235 development board.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Firmware Flashing&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Access the Firmware Flashing Interface on the Primary Sidebar&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are two methods:&lt;/p&gt;

&lt;p&gt;– Click on the QuecPython plugin icon on the primary sidebar .&lt;/p&gt;

&lt;p&gt;– Use the shortcut Ctrl+Shift+P to open the command palette, type &amp;gt; QuecPython in it, and select QuecPython: Focus on Firmware Manager View from the options, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0zh6c7zxe3x2dyeo1yq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0zh6c7zxe3x2dyeo1yq.png" alt=" " width="717" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The firmware flashing interface on the primary sidebar is shown in the following image:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwp1ogil771b5k399ld5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwp1ogil771b5k399ld5.png" alt=" " width="707" height="688"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select Firmware&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Click the Select Firmware button  on the firmware flashing interface, and choose the firmware package for the U-235 development board module.&lt;/p&gt;

&lt;p&gt;The path to the firmware package will be displayed on the interface:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdh6zr8zzegy407jshfjq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdh6zr8zzegy407jshfjq.png" alt=" " width="699" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Flash Firmware&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;i. Click the Flash button  on the firmware flashing interface.&lt;/p&gt;

&lt;p&gt;ii. In the pop-up confirmation window, click the Yes button &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feaoyzgvswzbms7jdt0u5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feaoyzgvswzbms7jdt0u5.png" alt=" " width="713" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can see the firmware flashing progress bar in the lower right corner of the VSCode interface:&lt;/p&gt;

&lt;p&gt;When the progress bar shows Flashing Firmware: 8/8 100%, the firmware flashing is complete, and the module will restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;REPL Command Interaction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before starting the REPL command interaction for QuecPython, it is necessary to flash the firmware that supports QuecPython functionality.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find the command to connect to the terminal in the command palette&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use the shortcut Ctrl+Shift+P to open the command palette. Enter &amp;gt; QuecPython in the palette and select QuecPython: Connect to COM Port from the options, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1sdel2i03k8pf9vwkqz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1sdel2i03k8pf9vwkqz.png" alt=" " width="712" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;connect to Terminal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Follow the instructions in the image below:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once the operation is completed, the module will be connected to the terminal in VSCode.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At the same time, the terminal window will pop up with the content as shown in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0p3thlvb6c1cdopxdymd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0p3thlvb6c1cdopxdymd.png" alt=" " width="711" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;REPL Command Interaction&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After pressing Enter in the terminal, you will see the QuecPython command prompt &amp;gt;&amp;gt;&amp;gt;.&lt;/p&gt;

&lt;p&gt;Enter the following code in the terminal:&lt;/p&gt;

&lt;p&gt;print("Hello, QuecPython!")&lt;/p&gt;

&lt;p&gt;After pressing Enter, you can see the execution result as shown in the following image:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09f4zow7vvhzyjxvafth.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09f4zow7vvhzyjxvafth.png" alt=" " width="706" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we have completed the simplest QuecPython REPL interaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;File Transfer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The edited script file test.py needs to be imported into the module’s file system to run.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;In the editor page of the file to be transferred (i.e., test.py), right-click the mouse.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the QPY: Download File command to start file transfer.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2m956x4vg6t83c1ycrxb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2m956x4vg6t83c1ycrxb.png" alt=" " width="622" height="808"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;During the file transfer process, a pop-up window appears in the bottom right corner of the VSCode interface, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovt3zpa68w7tvfyrf5yb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovt3zpa68w7tvfyrf5yb.png" alt=" " width="635" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;File System Directory Tree&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;After the file transfer is complete, click on the Explorer button  on the primary sidebar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the Explorer interface is open, look at the bottom and find QPY: FILE SYSTEM (USR). It shows the directory tree of the module’s file system /usr.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The imported file test.py is shown in the following image:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9147v0zpe2idekv0qv30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9147v0zpe2idekv0qv30.png" alt=" " width="629" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Run Script File&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Select the script file test.py in the directory tree.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Right-click on the script file test.py and choose Run Script to execute the script file.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtvoqc6ly46kc7z6op4a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtvoqc6ly46kc7z6op4a.png" alt=" " width="639" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the terminal window, you can see the script periodically outputting the string "Hello, QuecPython!".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0kcmytqmnvbrscqczab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0kcmytqmnvbrscqczab.png" alt=" " width="634" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Package Manager&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;From QuecPython menu -&amp;gt; Quick Access -&amp;gt; Quectel -&amp;gt; Projects + Components&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuh6w41djar1wtef0zhy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuh6w41djar1wtef0zhy0.png" alt=" " width="537" height="846"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List of Projects + Components will show in the panel&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmtoh5k1kynlkkx3s6nl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmtoh5k1kynlkkx3s6nl.png" alt=" " width="796" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>vscode</category>
      <category>plugin</category>
    </item>
    <item>
      <title>ADC- Analog-to-Digital Converter</title>
      <dc:creator>QuecPython</dc:creator>
      <pubDate>Fri, 17 Apr 2026 10:37:48 +0000</pubDate>
      <link>https://dev.to/quecpython/adc-analog-to-digital-converter-2407</link>
      <guid>https://dev.to/quecpython/adc-analog-to-digital-converter-2407</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;ADC Principles and Common Applications&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Analog signals are signals that have a continuous mathematical form in the time domain, with signal values continuously varying at different time points. They convey information about continuously changing physical quantities such as temperature, humidity, pressure, length, current, and more. Different types of data need to be converted into corresponding analog signals for transmission.&lt;/p&gt;

&lt;p&gt;Digital signals, on the other hand, are signals where both the independent and dependent variables are discrete. They can be understood as signals that are discrete both in the time domain and in amplitude, meaning they are not continuous. Digital signals are stored and processed in computers using binary representation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faldhorz1s2sbaxy2932u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faldhorz1s2sbaxy2932u.png" alt=" " width="711" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw13lffdaov1udw7wakw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw13lffdaov1udw7wakw8.png" alt=" " width="692" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using a processor with a working voltage of 3.3V as an example, it generates rectangular wave electrical signals during its operation, which are either 0V (logic 0) or 3.3V (logic 1). In the physical world, a voltage signal of 1V cannot be directly recognized by the CPU; it must be converted into a digital signal by a device called an ADC before it can be recognized by the CPU.&lt;/p&gt;

&lt;p&gt;ADC, short for Analog-to-Digital Converter, plays the role of transforming analog signals that computers cannot directly recognize in the physical world into binary digital signals that can be recognized by the CPU.&lt;/p&gt;

&lt;p&gt;The basic working principle of ADC involves sampling and quantization. First, ADC samples the analog signal, which means it measures the value of the analog signal at regular time intervals. Then, the sampled analog signal is quantized, which means it is discretized into a series of discrete numerical values. These numerical values are typically represented in binary.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcl4mrnoyllmpym1b6pyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcl4mrnoyllmpym1b6pyn.png" alt=" " width="707" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The resolution of an ADC represents its ability to quantify analog signals with precision. It refers to the number of discrete values that the ADC can represent. Resolution is typically measured in bits, such as 8-bit, 10-bit, 12-bit, and so on. For example, an 8-bit ADC can divide the input range into 2^8 (256) different discrete levels, while a 12-bit ADC can divide it into 2^12 (4096) discrete levels. Higher resolution means that the ADC can more accurately quantify analog signals.&lt;/p&gt;

&lt;p&gt;The sampling rate of an ADC is the number of times it samples per second. A higher sampling rate results in a more faithful representation of the original analog signal. According to the Nyquist Sampling Theorem, the sampling rate must be at least twice the maximum frequency of the signal being measured to avoid distortion in the sampled waveform. In practical applications, the sampling frequency is often much higher, sometimes even up to 10 times or more the maximum frequency of the signal being sampled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftqswhr89adx3fnhdypfa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftqswhr89adx3fnhdypfa.png" alt=" " width="765" height="583"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The input voltage range of an ADC (Analog-to-Digital Converter) refers to the range of analog signal voltages it can accept. It is typically expressed in voltage units, such as 0V to 5V or -5V to +5V. Ensuring that the input signal does not exceed the ADC’s input range is crucial to avoid signal distortion or damage.&lt;/p&gt;

&lt;p&gt;ADCs can be triggered in two main ways: software-triggered and hardware-triggered. In software triggering, the ADC starts the conversion immediately when a conversion command is issued in software. In hardware triggering, the ADC waits for a specified external event to occur before starting the conversion. The choice of triggering method depends on the specific application and requirements.&lt;/p&gt;

&lt;p&gt;ADCs find wide-ranging applications in various fields, including data acquisition, sensor interfacing, audio processing, communication systems, and more. They are essential components for converting analog signals into digital format, allowing analog signals to interact with and be processed by digital systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;ADC Descriptions for Various Platforms&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;ADCs are typically located on the PMU (Power Management Unit) and are part of the Analog IP. A typical structure diagram of the PMU is shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa10pgfpvqgsn5esdn5l6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa10pgfpvqgsn5esdn5l6.png" alt=" " width="723" height="813"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Application Scenarios&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Light Sensor&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Materials Needed: EC600U module, light-dependent resistor (e.g., GL5528)&lt;/p&gt;

&lt;p&gt;Principle:&lt;/p&gt;

&lt;p&gt;The resistance of a light-dependent resistor (LDR) changes with varying light intensity.&lt;/p&gt;

&lt;p&gt;When the LDR is exposed to light, its resistance decreases.&lt;/p&gt;

&lt;p&gt;When the light intensity decreases or there is no light, the resistance of the LDR increases, which affects the voltage at the test point.&lt;/p&gt;

&lt;p&gt;By reading the ADC voltage values, you can calculate the resistance value of the LDR. Based on the relationship between the light intensity and the resistance of the LDR, you can determine the intensity of the light.&lt;/p&gt;

&lt;p&gt;The hardware circuit is as shown in the diagram below: R2 is the LDR, R1 is 10K (you can choose the value of R1 based on the specific parameters of the LDR), and the ADC port is the test point connected to the module’s ADC pin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gvv5tfb3tzydf3lyr14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gvv5tfb3tzydf3lyr14.png" alt=" " width="697" height="827"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, you can observe the impact of different light levels on the LDR by printing the ADC-measured voltage values and the resistance values of the LDR.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs124kbgx54qh8cum3wdk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs124kbgx54qh8cum3wdk.png" alt=" " width="779" height="574"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;FAQ&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;ADC Voltage Range&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The input voltage for each ADC interface pin must not exceed its allowed voltage range. When the measured voltage is greater than the input voltage range, it should be first reduced by resistor division before connecting it to the module’s ADC pin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In cases where the module’s VBAT is not powered, to avoid damaging the module, ADC interfaces should not be directly connected to any input voltage.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;ADC Bit Width&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;ADC bit width refers to how many bits are used to represent the ADC conversion result. A larger bit width results in higher resolution and more precise measurements. For example, if a 1V voltage is converted by a 10-bit ADC, each bit represents 1/1024V. The module’s ADC returns the processed voltage value.&lt;/p&gt;

</description>
      <category>python</category>
      <category>micropython</category>
      <category>embedded</category>
      <category>adc</category>
    </item>
  </channel>
</rss>
