Digi MicroPython Programming Guide

Transcription

Digi MicroPythonProgramming Guide

Revision history—90002219RevisionDateDescriptionUAugust 2020 Added modem status, AT commands that do not work inMicroPython, delete bondings(), passkey enter(), passkey confirm(),secure(), io callbacks(), and receive callback(rx callback). Added thesecurity argument to config(). Noted Digi modified slicing.VDecember2020Added Idle device from MicroPython and apin.read u16().Updated Initiate sleep from MicroPython for the non-cellular devices.Updated Test the connection.Removed PyCharm section.WFebruary2021Added Recover an XBee device.XNovember2021Added digi.gnss module, dupterm method, and digi.cloud.Consle()module.YJune 2022Added the cellular.scan(deep, callback) method.Trademarks and copyrightDigi, Digi International, and the Digi logo are trademarks or registered trademarks in the United Statesand other countries worldwide. All other trademarks mentioned in this document are the property oftheir respective owners. 2022 Digi International Inc. All rights reserved.DisclaimersInformation in this document is subject to change without notice and does not represent acommitment on the part of Digi International. Digi provides this document “as is,” without warranty ofany kind, expressed or implied, including, but not limited to, the implied warranties of fitness ormerchantability for a particular purpose. Digi may make improvements and/or changes in this manualor in the product(s) and/or the program(s) described in this manual at any time.WarrantyTo view product warranty information, go to the following website:www.digi.com/howtobuy/termsCustomer supportGather support information: Before contacting Digi technical support for help, gather the followinginformation:Product name and modelProduct serial number (s)Digi MicroPython Programming Guide2

Firmware versionOperating system/browser (if applicable)Logs (from time of reported issue)Trace (if possible)Description of issueSteps to reproduceContact Digi technical support: Digi offers multiple technical support plans and service packages.Contact us at 1 952.912.3444 or visit us at www.digi.com/support.FeedbackTo provide feedback on this document, email your comments totechcomm@digi.comInclude the document title and part number (Digi MicroPython Programming Guide, 90002219 Y) in thesubject line of your email.Digi MicroPython Programming Guide3

ContentsDigi MicroPython Programming GuideReference material13Which features apply to my device?Use MicroPythonAccess the MicroPython environmentEnter MicroPython codeDirect entryExit MicroPythonDisplay toolsCoding tipsRecover an XBee device16161616161617MicroPython syntaxColonsAfter conditional statements and loop statementsIndentationsFOR loop with one statement indentedFOR loop with two statements indentedFunctionsFunction with arguments19191919202020Errors and exceptionsSyntax errorExampleName errorReferencing a name that was not createdReferencing a name from one function that was created in a different functionOSErrorSocket errorsENOTCONN: Time out errorENFILE: No sockets are availableENXIO: No such device or addressDigi MicroPython Programming Guide232323232324242424244

Keyboard shortcutsKeyboard shortcutsSelect a previously typed statement2626Differences between MicroPython and other programming languagesMemory managementVariable typesSyntaxCurly braces and indentationSemicolonsIncrement operatorLogical operators28282829303031Develop applications on an XBee deviceSpace allocated to MicroPythonCode storageBuilt-in modules embedded in XBee firmware (device flash)Source code in .py files (file system)Parsed and compiled code in .mpy files (file system)Executable code on MicroPython heap (device RAM)Compiled modules relocated from file system to device flashHow to organize your codeRun code at startupMonitor memory usageThe gc moduleThe micropython moduleEfficient codingApplication evolutionOne-liners in the REPLShort blocks in paste modeFlash upload modeModules stored as .py filesCompiled modules stored as .mpy filesCompiled modules via Flash upload modeCompiled modules embedded in device flashDigi modified slicing for bytes and strings 4040Power management in MicroPythonPrevent sleep from MicroPythonXBee Cellular Modem:XBee 3 Zigbee RF Module, XBee 3 802.15.4 RF Module, XBee 3 DigiMesh RF Moduledescription:Initiate sleep from MicroPythonXBee Cellular Modem:XBee 3 Zigbee RF Module, XBee 3 802.15.4 RF Module, XBee 3 DigiMesh RF Module:Sleeping with AT commandsIdle a device from MicroPythonEnter and exit the idle statePoll for data while the device is idleDigi MicroPython Programming Guide424242434343444444455

Access the primary UARTHow to use the primary UARTsys.stdin limitationsExample: read bytes from the UARTExample: read the first 15 bytes from the UART48484849REPL (Read-Evaluate-Print Loop) examplesCtrl A: Enter raw REPL modeCtrl B: Print the MicroPython bannerPrint the bannerPrint the banner and verify that the memory was not wipedCtrl C: Regain control of the terminalCtrl D: Reboot the MicroPython REPLCtrl E: Enter paste modePaste one line of codePaste a code segmentCtrl F: Upload code to flashLoad code to flash memoryErase the code stored in flash memoryFlash memory and automatic code executionRun stored code at start-up to flash LEDsDisable code from running at start upCtrl R: Run code in flashEnable code to run at start-upPerform a soft-reset or reboot515152525354545455555657575758595960Access file system in MicroPythonModify file system )uos.rmdir(dir)uos.rename(old path, new path)uos.replace(old path, new path)uos.sync()uos.compile(source file, mpy file None)uos.format()uos.hash([secure file])Access data in filesFile object methodsread(size -1)readinto(b)readline(size -1)readlines()write(b)seek(offset, whence 0)tell()flush()Digi MicroPython Programming 5656

close()Import modules from file systemReload a moduleCompiled MicroPython files65656666Send and receive User Data Relay framesConstantsInterfaces (always t, data)Exceptionsrelay.callback(my callback)Examples686868686868686869MicroPython libraries on GitHubMicroPython modulesXBee-specific functionsStandard modules and functionsDiscover available modules727273Machine moduleReset-causeConstantsRandom numbersUnique identifierClass PWM (pulse width modulation)Class ADC: analog to digital conversionConstructorsMethodsSample programClass I2C: two-wire serial protocolConstructorsGeneral methodsStandard bus operations methodsMemory operations methodsSample programsClass PinClass UARTTest the UART interfaceUse the UART classConstructorsMethodsConstantsClass WDT: watchdog timerAccess the XBee device's I/O pinsUse the Pin() constructorUse mode() to configure a pinDigi MicroPython Programming 68688897

Pin.DISABLEDPin.INPin.OUTPin.ALTPin.ANALOGPin.OPEN DRAIN and Pin.ALT OPEN DRAINUse pull() to configure an internal pull up/down resistor89898990909090digi.ble moduleFeature supportactive()config()Query a valueUpdate configuration valuesdisconnect code()gap connect() addr type address timeout ms interval us , window us onclose Return valuegap connection methodsgattc services()gattc characteristics()gattc descriptors()gattc read characteristic()gattc configure()gattc read descriptor()gattc write characteristic()gattc write re()io callbacks()delete bondings()passkey enter()passkey confirm()UUID() value Return valuegap scan() duration ms interval us , window us oldest Return valuegap scan methodsget()any()stop()stopped()gap scan advertisement formatDigi MicroPython Programming 41041041051051051058

Use gap scan as an iteratorUse gap scan as a context managergap advertise() interval us adv data Return valuexbee connect() gap connection receive password timeout Return valuexbee connection methodsdigi.ble samplesGeneric gap advertising and gap scanning samplesEddystone Beaconing samplesiBeacon samplesTroubleshootingFewer advertisements than expected when using gap 08108109109Cellular network configuration moduleConfigure a specific network interfaceclass CellularConstructorsCellular power and airplane mode methodVerify cellular network connection methodCellular connection configuration methodCellular active scan methodSend an SMS message methodReceive an SMS message methodRegister an SMS Receive Callback methodCellular shutdown methodRSRP/RSRQ reporting in e moduleAT commands that do not work in MicroPythonclass XBee on XBee Cellular ModemConstructorsMethodsXBee MicroPython module on the XBee 3 RF ModulesFunctionsatcmd()discover()receive()receive callback(rx callback)transmit()modem ud moduleCreate and upload data pointsDigi MicroPython Programming Guide1259

class DataPointsConstructorOptional parameterAdd a data point methodUpload data to Digi Remote Manager methodCheck the status of a DataPoints objectThe life-cycle of a DataPoints objectDelete a DataPoints objectReceive a Data Service Device Requestclass device requestUse the read(size -1) methodUse the readinto(b) methodUse the write(b) methodUse the close() methodUse the API Explorer to send Device Requestsdigi.cloud.Console() objectisconnected() methodread(size) methodreadinto(buf) methodwrite(buf) methodclose() 9130130130130130130The ussl moduleussl on the XBee Cellular ModemSyntaxUsage132132132digi.gnss moduleGNSS module methodssingle acquisition(callback, timeout 60)raw mode(callback)GNSS examples134134134135Terminal redirectiondupterm(stream obj, index 0)137Use AWS IoT from MicroPythonAdd an XBee Cellular Modem as an AWS IoT deviceCreate a policy for access controlCreate a ThingInstall the certificatesTest the connectionPublish to a topicConfirm published dataSubscribe to updates from AWSDigi MicroPython Programming Guide13913914014214314514614610

Time module example: get the current timeRetrieve the local timeRetrieve time with a loopDelay and timing quick reference149149150Cellular network connection examplesCheck the network connectionCheck network connection with a loopCheck network connection and print connection parameters152152153Socket examplesSocketsBasic socket operations: sending and receiving data, and closing the network connectionBasic data exchange code sampleResponse header linesSpecialized receiving: send received data to a specific memory locationDNS lookupDNS lookup code outputSet the timeout value and blocking/non-blocking modeSend an HTTP request and dump the responseSocket errorsENOTCONN: Time out errorENFILE: No sockets are availableENXIO: No such device or addressUnsupported /O pin examplesChange I/O pinsPrint a list of pinsChange output pin values: turn LEDs on and offPoll input pin valuesCheck the configuration of a pinCheck the pull-up mode of a pinMeasure voltage on the pin (Analog to Digital Converter)165165166166167169170SMS examplesSend an SMS messageSend an SMS message to a valid phone numberCheck network connection and send an SMS messageReceive an SMS messageSample codeReceive an SMS message using a callback173173173174174175XBee device examplesPrint the temperature of the XBee Cellular ModemPrint the temperature of the XBee 3 Zigbee RF ModuleDigi MicroPython Programming Guide17717711

Print a list of AT commandsxbee.discover() examplesHandle responses as they are receivedGather all responses into a listxbee.transmit() examplesxbee.transmit() using constantsxbee.transmit() using byte stringDigi MicroPython Programming Guide17818018018118118118112

Digi MicroPython Programming GuideThis guide introduces the MicroPython programming language by showing how to create and run asimple MicroPython program. It includes sample code to show how to use MicroPython to performactions on a Digi device, particularly those devices with Digi-specific behavior. It also includesreference material that shows how MicroPython coding can be used with Digi devices.You can code MicroPython to transform cryptic readings into useful data, filter out excesstransmissions, directly employ modern sensors and actuators, and use operational logic to glue inputsand outputs together in an intelligent way.The XBee Cellular Modem has MicroPython running on the device itself. You can access a MicroPythonprompt from the XBee Cellular Modem when you install it in an appropriate development board(XBDB or XBIB), and connect it to a computer via a USB cable.Reference materialMicroPython is an open-source programming language based on the Python 3 standard library.MicroPython is optimized to run on a microcontroller, cellular modem, or embedded system.Refer to the Get started with MicroPython section of the appropriate user guide for information onhow to enter the MicroPython environment and several simple examples to get you started:nDigi XBee PyCharm IDE Plugin User GuidenDigi XBee Cellular Embedded Modem User GuidenDigi XBee Cellular 3G Global Embedded Modem User GuidenDigi XBee 3 Cellular LTE Cat 1 Smart Modem User GuidenDigi XBee 3 Cellular LTE-M Global Smart Modem User GuidenXBee 3 802.15.4 RF Module User GuidenXBee 3 DigiMesh RF Module User GuidenXBee 3 Zigbee RF Module User GuideThis programming guide assumes basic programming knowledge. For help with programmingknowledge, you can refer to the following sites for Python and MicroPython:nMicroPython: micropython.orgnMicroPython documentation: docs.micropython.orgnMicroPython Wiki: wiki.micropython.orgnPython: python.orgDigi MicroPython Programming Guide13

Which features apply to my device?MicroPython features and errors differ depending on the device you use. Unless specified, informationin this document applies to all devices. This table covers which features apply to specific products:FeatureXBee 3 Cellular XBee 3 Zigbee, DigiMesh, and 802.15.4Digital I/OYesYesI2CYesYesPower managementYesYesIdle from MicroPythonNoYesDigi Remote ManagerYes1NoSecondary UARTYesNoReal-time clockYesNoFile systemYesYesFile system - concurrent file writesYesNoFile system - renameYesNoFile system - Edit files after creationYesNoFile System - deleteYesNo2File System - secure filesYesNoFile System preserved across updatesYesNoGNSS on demandYes3No1Remote Manager features are only supported on XBee 3 Cellular devices, not XBee Cellular.2Files can be deleted, but doing so does not reclaim their space on the file system.3XBee 3 Global LTE-M/NB-IoT, XBee 3 Global LTE Cat 1, and XBee 3 North America LTE Cat 1 only.Digi MicroPython Programming Guide14

Use MicroPythonAccess the MicroPython environmentEnter MicroPython codeExit MicroPythonDisplay toolsCoding tipsRecover an XBee deviceDigi MicroPython Programming Guide16161616161715

Use MicroPythonAccess the MicroPython environmentAccess the MicroPython environmentTo begin using MicroPython on the XBee device, open XCTU and enter MicroPython mode. See UseXCTU to enter the MicroPython environment in the appropriate user guide.Enter MicroPython codeYou can use different methods to enter MicroPython code into the MicroPython Terminal on the XBeedevice.nDirect entry: Manually type code into the MicroPython Terminal.nPaste mode: Use the REPL paste mode to paste copied code into the MicroPython Terminal forimmediate execution.nFlash mode: Use the REPL flash mode to paste a block of code into the MicroPython Terminaland store it in flash memory.nAccess file system in MicroPython: Upload code to the file system.Direct entryFrom a serial terminal, you can type code at the MicroPython REPL prompt. When you press Enter,the line of code runs and another MicroPython prompt appears. Manually typing in code is thesimplest method.Example1. Access the MicroPython environment.2. At the MicroPython prompt, type print("This is a simple line of code") and then pressEnter. The phrase in quotes prints in the terminal: This is a simple line of codeExit MicroPythonWhen you are done coding, exit MicroPython by closing the MicroPython terminal. Any code that hasbeen executed will continue to run, even if the XBee device is set to Transparent or API mode.For additional instructions, see the Exit MicroPython mode section in the appropriate user guide.Display toolsMicroPython mode requires echo to be turned off in terminal emulation. Command mode does notecho your input back to you. In order to see what you are typing, use the appropriate display tool:nMicroPython mode: For MicroPython coding, use the XCTU MicroPython Terminal or configureyour terminal emulator for "echo off."nCommand mode: For device configuration that is done in Command mode (initiated bysending to the device), use the XCTU Serial Console or configure your terminal emulatorfor "echo on."Coding tipsFor all XBee devices:Digi MicroPython Programming Guide16

Use MicroPythonRecover an XBee devicenUse the integer division operator (//) unless you need a floating point.nMicroPython's struct time does not include the tm isdst element in the tuple.For the XBee Cellular Modem:nThe XBee Cellular Modem supports the use of hostnames in socket.connect() calls, unlikeother MicroPython platforms that require an IP address obtained by doing a manual look-upusing socket.getaddrinfo().For the XBee 3 Zigbee RF Module:nThe Micropython time.time() function returns the number of seconds since the epoch. TheXBee 3 Zigbee RF Module does not have a realtime clock, so it does not support time.time().To track elapsed time, use time.ticks ms().For XBee3 radio modules:nThe counter for the Micropython ticks us() function will fall behind ticks ms() by about 1 msevery 10 seconds.nIf you need a high level of accuracy over a long period of time, use ticks ms().Recover an XBee deviceIf you are unable to communicate with an XBee device when a MicroPython script is running—forexample, if your MicroPython code is changing settings such as ATBD to strange values—you canrecover the XBee device by holding serial break—DIN line low—while the XBee is reset or powered up.If serial break is held during reset/power-on, the XBee will enter Command mode at 9600 baud, andMicroPython will not execute until Command mode is exited.While in Command mode you can then set ATPS to 0 to disable MicroPython autostart, for example.You can also query and set ATBD or other commands to assist in restoring communication with theXBee.Note See Break control for related information.Digi MicroPython Programming Guide17

MicroPython syntaxSyntax refers to rules that must be followed when entering code into MicroPython. If you do notfollow the syntax rules when coding, errors are generated, and the code may not run as expected ornot run at all.For information about coding errors, see Errors and exceptions.The following sections describe coding syntax rules.ColonsIndentationsFunctionsDigi MicroPython Programming Guide19192018

MicroPython syntaxColonsColonsMicroPython requires a colon (:) after you entered the following statement types:nFunction name and the arguments that function accepts, if anynCondition statementnLoop statementDefining a functionA function consists of the following:ndef keywordnFunction namenAny arguments the function takes, inside a set of parentheses. The parentheses remain emptyif there are no passed argumentsnThe function declaration must be followed by a colonThe code sample below is a basic function definition. Note that a colon is entered after the functionname. This colon defines the following indented lines as part of the function. Indentation is equallyimportant, and is discussed in Indentations.def sample function():print("I am a sample function!")After conditional statements and loop statementsA colon is required after each conditional statement and loop statement. The code sample belowshows how the colon is used for a conditional statement (if True:) and for a loop statement (for x inrange(10):). if True:print("Condition is true!")for x in range(10):print("Current number: %d" % x)IndentationsIn MicroPython, an indentation tells the compiler which statements are members of a function,conditional execution block, or a loop. If a line is not indented, that line is not considered a part of thefunction, conditional execution block, or loop.A function declaration, conditional execution block, or loop should be followed by a colon. All codeafter the colon that is meant to be part of that block must be indented. For more information abouthow colons are used in the code, see Colons.FOR loop with one statement indentedIn this example, only one statement after the initial FOR loop statement (which ends in a colon) isindented. When the loop is executed, only line 2 of the code is executed. When the loop completes,the code at line 3 executes.Digi MicroPython Programming Guide19

MicroPython syntaxFunctionsWhen this code executes, it prints "In the FOR loop, iteration # number " 10 times, where number is 0 in the first loop of the code, and 9 at the last loop. Line 3 of the code runs one time,after the loop completes, printing the phrase "Current number: 9" one time.for x in range(10):print("In the FOR loop, iteration # %d" % x)print("Current number: %d" % x)FOR loop with two statements indentedIn this example, both statements after the initial FOR loop statement (which ends in a colon) areindented. When the loop is executed, both print statements are printed in each loop iteration.As in the previous example, the code prints "In the FOR loop, iteration # number ", where number is 0 in the first loop of the code, and 9 at the last loop. This time, however, line 3 of thecode is run in each loop iteration, and prints the phrase "Current number: number". Both phrasesare printed 10 times, with the number starting at 0 and increasing by one on each loop.for x in range(10):print("In the FOR loop, iteration # %d" % x)print("Current number: %d" % x)FunctionsA function is an operation that performs an action and may return a value. A function consists of thefollowing:ndef keyword. The def keyword is required, and is short for "define".nFunction name.nAny arguments the function takes, defined by a set of parentheses. The parentheses remainempty if there are no passed arguments.nThe function statement must be followed by a colon. For more information, see Colons.The code sample below is a basic function definition. Note that the colon is entered after the functionname and parentheses. This colon defines that everything after that line that is indented is part of thefunction. Indentation is equally important, and is discussed in the Indentations section.def example function():print("I am a function!")Function with argumentsThis sample shows how to define a function and then how to call the function to perform an operationand return a value.nLine 1: Define the function and define two arguments: x and y.nLine 2: Define the variable that holds the sum of the arguments as sum val.nLine 3: Define a phrase that will be printed to the terminal including sum val .nLine 4: The function returns the value of its own variable sum val. A returned value can beused and stored outside of the function.nLine 6: Define the value of the variable global sum to be the value returned by the functionDigi MicroPython Programming Guide20

MicroPython syntaxFunctionsdefined in line 1: addition function(3,4), which is equal to the returned variable sum val.nLine 7: Define that a phrase that includes global sum is printed to the terminal.def addition function(x,y):sum val x yprint("value of sum (x y): %d" % sum val)return sum valglobal sum addition function(3,4)print("Value of global sum: %d" % global sum)Note You can copy and paste code from the online version of the Digi MicroPython ProgrammingGuide. Use caution with the PDF version, as it may not maintain essential indentations.Digi MicroPython Programming Guide21

Errors and exceptionsIf something goes wrong during compilation or during execution of code you have entered, you mayget an error. The type of error that occurred and the line number that caused the error will print to theterminal. Errors can happen for many reasons, such as syntax errors, name errors (which generallymeans the variable or function you are referencing is not available), or other more specific errors.Note Some exceptions have Error in their name and others have Exception.Common types of errors include:Syntax errorName errorOSErrorSocket errorsDigi MicroPython Programming Guide2323242422

Errors and exceptionsSyntax errorSyntax errorA syntax error occurs when a MicroPython code statement has the wrong syntax.ExampleIn this example, the syntax is incorrect. A colon is missing after the word "True".if True print("Condition is true!")When you press Enter to run the code it generates the following Exception describing the error(SyntaxError) and the execution path that led to it (line 1 of the code you entered).Traceback (most recent call last):File " stdin ", line 1SyntaxError: invalid syntaxThe correct code syntax is:if True: print("Condition is true!")Name errorA name error is generated when a name of an item, such as a variable or function, cannot be found.This can occur when:nYou typed the name into the code incorrectly.nYou are referencing a name that was never created.nThe name is defined, but is not in scope when you reference it. For example, if you defined thename in function A, but are referencing the name in function B.Referencing a name that was not createdIn this example, the name deviation factor was not created. If you reference this name in the code, aNameError occurs in line 4, as the code references the deviation factor name, which was notcreated.print("Assigning value to x.")x 17print("Adding deviation factor to x.")x x deviation factorReferencing a name from one function that was created in adifferent functionIn this example, a variable is created in the example func. When you run the code, the NameErrorreferences line 8, where the code tries to print local variable. The variable was created inside thefunction example func, and the scope of that variable, meaning where it can be accessed, is in thatfunction. The code references local variable outside of that function.def example func():print("Entering example function.")local variable "I'm a variable inside this function"Digi MicroPython Programming Guide23

Errors and exceptionsOSErrorprint(local variable)example func()print(local variable)OSErrorMicroPython returns an OSError when a function returns a system-related error.For example, if you try to send a message on a Zigbee network:import xbeexbee.transmit(xbee.ADDR COORDINATOR, 'Hello!')This code assumes that the device is associated to a network and able to send and receive data.If the device is not associated with a network, it produces an OS error:OSError: [Errno 7107] ENOTCONN.Socket errorsNote This section only applies to the XBee Cellular Modem. See Which features apply to my device?for a list of the supported features.This following socket errors may occur.ENOTCONN: Time out errorIf a socket stays idle too long, it will time out and disconnect. Attempting to send data over a socketthat has timed out produces the OSError ENOTCONN, meaning "Error, not connected." If thishappens, perform another connect() call on the socket to be able to send data again.ENFILE: No sockets are availableThe socket.socket() or socket.connect() method returns an OSError (ENFILE) exception if no socketsare available. If you are already using all of the available sockets, this error may occur in the fewseconds between calling socket.close() to close a socket, and when the socket is completely closedand returned to the socket pool.You can use the following methods to close sockets and make more sockets available:nClose abandoned sockets: Initiate garbage collection (gc.collect()) to close any abandonedMicroPython sockets. For example, an abandoned socket could occur if a socket was created ina function but not returned. For information about the gc module, see the MicroPythongarbage collection documentation.nClose all allocated sockets: Press Ctrl D to perform a soft reset of the MicroPython REPL toclose all allocated sockets and return them to the socket pool.ENXIO: No such device or addressOSError(ENXIO) is returned when DNS lookups fail from calling usocket.getaddrinfo().Digi MicroPython Programming Guide24

Keyboard shortcutsThis section includes keyboard shortcuts you can use to make coding with MicroPython easier.Keyboard shortcutsSelect a previously typed statementDigi MicroPython Programming Guide262625

Keyboard shortcutsKeyboard shortcutsKeyboard shortcutsXCTU version 6.3.6.2 and higher works when the REPL is enabled. The MicroPython Terminal toolallows you to communicate with the MicroPython stack of your device through the serial interface.The MicroPython Terminal tool in XCTU supports the following control characters:Ctrl A: Enter raw REPL mode. This is like a permanent paste mode, except that characters are notechoed back.Ctrl B: Print the MicroPython banner. Leave raw mode and return to the regular REPL (also known asfriendly REPL). Reprints the MicroPython banner followed by a REPL prompt.Ctrl C: Regain control of the terminal. Interrupt the currently running program.Ctrl D: Reboot the MicroPython REPL. Soft-reset MicroPython, clears the heap.Ctrl E: Enter paste mode. Does not auto-indent and compiles pasted code all at once beforeexecution. Uses a REPL prompt of . Use Ctrl-D to compile uploaded

Revisionhistory—90002219 Revision Date Description U August2020 Addedmodem_status,ATcommandsthatdonotworkin key .