LTE Cat.1

Wio Tracker (Wireless Input Output) is an open source gateway which enable faster IoT GPS solutions. It is Arduino and Grove compatible development boards that helps you track nearly any moving thing on the planet and then upload that data wirelessly. The Wio LTE is the LTE version of Wio Tracker, so now we’ve got 2 versions of Wio Tracker and the LTE (4G) version will make some differences.

There are three main updates comparing the Wio LTE to the 2G version. Firstly, from its name we know that the Wio LTE supports LTE (4G) communication which is much faster and popular than 2G. Secondly, the Wio LTE supports in total 4 different GNSS – GPS, Beidou, GLONSS and Galileo, the QZSS is also supported as bonus. With more GNSS support, positioning will be more accurate. Thirdly, the Wio LTE‘s MCU is upgraded to STM32, which is based on Cortex-M4, makes the Wio LTE 5 times faster than the 2G version. What’s more, the flash and RAM have also been raised to 1Mbytes and 192+4k bytes.

Apart from the three main updates, the LTE version is almost the same as the 2G version. If your project is using the 2G version, it would be very easy to update to the LTE version because we have prepared transplantable and expansible AT command library. The Arduino and Grove compatibility allows for quicker development through numerous libraries and a supportive community. The GPS library which will be available with the board is not just limited to Arduino – it can function just as well if you chose to develop in C/C++. With the onboard 6 Grove connections, developers can create any combination of our 180+ sensors and actuators to build project and solve any problem. Simplifying the prototyping and development phase is our goal.

The Wio LTE is well suited for outdoor projects where the device can connect to the GPS satellites and provide a real-time location of the item it is attached to. The LTE provides a wide bandwidth which allows much faster interaction between the user and device. If you are going to build projects like a bicycle sharing service, tracking pets or livestock, locating a vehicle, or even keeping track of a child, the Wio LTE is the best solution.

Wio Tracker(无线输入输出)是一个开源网关,可实现更快的物联网GPS解决方案。它是Arduino和Grove兼容的开发板,可以帮助您跟踪地球上几乎任何移动的东西,然后无线上传该数据。 Wio LTE是Wio Tracker的LTE版本,所以现在我们有两个版本的Wio Tracker和LTE(4G)版本会产生一些差异。

将Wio LTE与2G版本进行比较有三个主要更新。首先,从它的名字我们知道Wio LTE支持LTE(4G)通信,它比2G更快更流行。其次,Wio LTE共支持4种不同的GNSS - GPS,北斗,GLONSS和Galileo,QZSS也作为奖励支持。随着更多GNSS的支持,定位将更加准确。第三,Wio LTE的MCU升级到STM32,它基于Cortex-M4,使Wio LTE比2G版本快5倍。更重要的是,闪存和RAM也已提升到1M字节和192 + 4k字节。

除了三个主要更新外,LTE版本与2G版本几乎相同。如果您的项目使用2G版本,那么更新到LTE版本将非常容易,因为我们已经准备好可移植且可扩展的AT命令库。 Arduino和Grove兼容性允许通过众多库和支持性社区更快地开发。板上可用的GPS库不仅限于Arduino - 如果您选择使用C / C ++进行开发,它也可以正常工作。通过板载6 Grove连接,开发人员可以创建180多个传感器和执行器的任意组合,以构建项目并解决任何问题。简化原型设计和开发阶段是我们的目标。

Wio LTE非常适合户外项目,在这些项目中,设备可以连接到GPS卫星,并提供所附物品的实时位置。 LTE提供宽带宽,允许用户和设备之间更快的交互。如果您打算建立自行车共享服务,跟踪宠物或牲畜,定位车辆,甚至跟踪孩子等项目,Wio LTE是最佳解决方案。

Specifications¶

  • ARM Cortex-M4 microcontroller LTE CAT M1 and NB-IoT combo for global
  • GPS/GLONASS GNSS supported
  • Espruino(JavaScript) compatible
  • Arduino IDE compatible (partly)
  • 6 x Grove port on-board, support 180 Grove modules at most
  • Easy migration from Wio LTE CAT.1

Hardware Features¶

  • STM32F405RG,ARM Cortex-M4, CPU running up to 168MHZ
  • 1Mbytes Flash
  • 192+4KBytes RAM
  • System
    • Operating voltage: 3.3V
    • Low power: Sleep/Standby modes/Stop
    • CRC-32 generator
  • LTE Connectivity
    • LTE CAT M1 and NB-IoT, Cat M1 Half-duplex (375 kb/s DL and UL) Cat NB1 Half-duplex (27.2 kb/s DL, 62.5 UL)
    • Embed protocol: TCP/UDP/FTP/HTTP/HTTPS/FTPS/TLS/MQTT/CoAP
  • GNSS
    • GPS/GLONASS
    • 2.5m CEP(GPS), 4.0m CEP(GLONASS)
  • Peripheral
    • 1 x USB for power supply and DFU
    • JST 1.0 connector for battery
    • 3 Buttons: 1. for Reset 2. for User function 3. into upload mode
    • Nano SIM and TF card 2 in 1 socket
  • Grove
    • 2 x Digital Port
    • 2 x Analog Port
    • 1 x UART
    • 1 x I2C

产品规格

ARM Cortex-M4微控制器LTE CAT M1和NB-IoT组合用于全球
支持GPS / GLONASS GNSS
Espruino(JavaScript)兼容
Arduino IDE兼容(部分)
板载6个Grove端口,最多支持180个Grove模块
从Wio LTE CAT.1轻松迁移
硬件功能

STM32F405RG,ARM Cortex-M4,CPU运行速度高达168MHZ
1Mbytes Flash
192 + 4KBytes RAM
系统
工作电压:3.3V
低功耗:睡眠/待机模式/停止
CRC-32发生器
LTE连接
LTE CAT M1和NB-IoT,Cat M1半双工(375 kb / s DL和UL)Cat NB1半双工(27.2 kb / s DL,62.5 UL)
嵌入协议:TCP / UDP / FTP / HTTP / HTTPS / FTPS / TLS / MQTT / CoAP
GNSS
GPS / GLONASS
2.5米CEP(GPS),4.0米CEP(GLONASS)
外围设备
1个USB供电和DFU
JST 1.0电池连接器
3个按钮:1。用于复位2.用于用户功能3.进入上传模式
Nano SIM和TF卡2合1插座
Grove
2个数字端口
2个模拟端口
1 x UART
1个I2C

Applications¶

  • Smart city
  • Smart meter
  • Smart energy
  • Smart agriculture
  • Smart retail
  • Smart supply chain
  • Smart transportation
  • Connected car
  • Connected building
  • Connected Health
  • Sports equipment
  • Pet tracking
  • Property security
  • Shared bicycle
  • Logistics transport positioning system
  • Others

应用

智慧城市
智能电表
智能能源
智能农业
智能零售
智能供应链
智能交通
智能互联汽车
智能建筑
智能健康
体育器材
宠物追踪
财产安全
共用自行车
物流运输定位系统
其他

Hardware Overview

Getting Started¶

Install USB driver¶

  • Windows Users: Most versions of Windows won't automatically load the built-in driver for USB com ports. You'll have to download ST's USB driver:

    • Non-Windows XP Users download version 1.4.0 drivers. Unzip the file, run the executable, and then go to C:\Program Files (x86)\STMicroelectronics\Software\Virtual comport driver in Windows Explorer and double-click either dpinst_amd64.exe for 64 bit systems, or dpinst_x86.exe for 32 bit.

    • Windows XP Users download version 1.3.1 drivers. Unzip the file, run VCP_V1.3.1_Setup.exe, and then go to C:\Program Files\STMicroelectronics\Software\Virtual comport driver in Windows Explorer and double-click the executable.

  • Linux users to ensure that you have the correct permissions to connect as a normal user you'll need to copy the file 45-espruino.rules to /etc/udev/rules.d, reload rules with udevadm control --reload-rules, and ensure your user is in the plugdev group (you can check by typing groups). You add it by typing sudo adduser $USER plugdev and then logging out and back in. Arch Linux users need to add their user to uucp and lock groups instead.

  • Mac OS X and Chromebook Users: The board will just plug in and work, without drivers!

    入门

    安装USB驱动程序

    Windows用户:大多数Windows版本不会自动加载USB com端口的内置驱动程序。你必须下载ST的USB驱动程序:
    非Windows XP用户下载1.4.0版驱动程序。解压缩文件,运行可执行文件,然后转到Windows资源管理器中的C:\ Program Files(x86)\ STMicroelectronics \ Software \ Virtual comport驱动程序,双击64位系统的dpinst_amd64.exe或32位dpinst_x86.exe位。
    Windows XP Users下载1.3.1版驱动程序。解压缩文件,运行VCP_V1.3.1_Setup.exe,然后转到Windows资源管理器中的C:\ Program Files \ STMicroelectronics \ Software \ Virtual comport驱动程序,然后双击可执行文件。
    Linux用户要确保您具有正常权限才能以正常用户身份连接,您需要将文件45-espruino.rules复制到/etc/udev/rules.d,使用udevadm control重新加载规则--reload-rules,并确保您的用户在plugdev组中(您可以通过键入组进行检查)。您可以通过键入sudo adduser $ USER plugdev然后注销并重新登录来添加它.Arch Linux用户需要将其用户添加到uucp并锁定组。
    Mac OS X和Chromebook用户:电路板只需插入即可工作,无需驱动程序!

Change DFU driver 更改DFU驱动程序

For windows users:对于Windows用户:

  • Step 1. Press and hold BOOT button and connect to computer you will see STM32 Device in DFU Mode at device manager as below.步骤1.按住BOOT按钮并连接到计算机,您将在设备管理器中看到DFU模式下的STM32设备,如下所示。

  • Step 2. This says that you need to use zadig_xx.exe to change DFU driver from STTub30 to WinUSBas below. If we can't see any info on the Zadig, please click Options→ List All Devices, then select STM32 Virtual COM Ports. 步骤2.这表示您需要使用zadig_xx.exe将DFU驱动程序从STTub30更改为WinUSB,如下所示。 如果我们在Zadig上看不到任何信息,请单击选项→列出所有设备,然后选择STM32虚拟COM端口。

  • Step 3. You will see the "STMicroelectronics Virtual COM Port" on device manager as below. 步骤3.您将在设备管理器上看到“STMicroelectronics Virtual COM Port”,如下所示。

Play with Arduino¶

1. Software Configuration

  • Step 1. Install Arduino IDE, recommand IDE version upon 1.8.0.
  • Step 2. Follow How to Add Seeed boards to Arduino IDE to add Seeed STM32F4 Boards into arduino board manager.
  • Step 3. Download the WioLTE_Cat_NB1_Arduino_Library from Github.
  • Step 4. Refer How to install library to install library for Arduino.
  • Step 5. Before uploading the sketch, press and hold both BOOT0 and RST buttons, release the RST button than the BOOT0 button, in this way the board will go into STM BOOLARDER mode.
  • Step 6. Don't choose any Serial port to upload the sketch in tools label just click upload icon.

2. Play with On board RGB LED

  • Step 1. Select File→ Examples→WioLTE_Cat_NB1_Arduino_Library→Seeed_WS2812b sketch.
  • Step 2. Press and hold BOOT button at back side of the Wio LTE Cat NB1 and plug the USB to PC.
  • Step 3. We will see STM BOOTLARDER in device manager.
  • Step 4. Select Tools→Boards→Wio_Tracker_LTE.
  • Step 5. Keep COM Port blank.
  • Step 6. Select Sketch→Upload to upload the code to Wio_LTE

配置Arduino

1.软件配置

步骤1.安装Arduino IDE,在1.8.0上推荐IDE版本。
步骤2.按照如何将Seeed板添加到Arduino IDE中,将Seeed STM32F4板添加到arduino板管理器中。
步骤3.从Github下载WioLTE_Cat_NB1_Arduino_Library。
步骤4.参考如何安装库以安装Arduino库。
步骤5.在上传草图之前,按住BOOT0和RST按钮,松开RST按钮而不是BOOT0按钮,这样电路板将进入STM BOOLARDER模式。
步骤6.不要选择任何串口上传工具标签中的草图只需单击上传图标。
2.使用板载RGB LED播放

步骤1.选择文件→示例→WioLTE_Cat_NB1_Arduino_Library→Seeed_WS2812b草图。
步骤2.按住Wio LTE Cat NB1背面的BOOT按钮,将USB插入PC。
步骤3. 我们将在设备管理器中看到STM BOOTLARDER。
步骤4.选择工具→板→Wio_Tracker_LTE。
步骤5.将COM端口保持空白。
步骤6.选择Sketch→Upload将代码上传到Wio_LTE

#include 
#include 

#define LEN_NUM 1

Ublox_sara_r4 ublox = Ublox_sara_r4();
WS2812 strip = WS2812(LEN_NUM, ublox.RGB_LED_PIN);

void setup() {
  // Set RGB LED power pin high
  ublox.enableRGBPower();
  strip.begin();
  strip.brightness = 20;
}

void loop() {  
  strip.RGBCycle(1000);   
  strip.rainbowCycle(20);
}
  • Step 7. Press RST, then you can see the on board RGB LED work.

3. Play with GNSS

  • Step 1. Plug the Nano SIM card into Nano SIM slot, near PCB board side.
  • Step 2. Select File→ Examples→WioLTE_Cat_NB1_Arduino_Library→GNNS→GNSS sketch.
  • Step 3. Press and hold BOOT button at back side of the Wio LTE Cat NB1 and plug the USB to PC.
  • Step 4. We will see STM BOOTLARDER in device manager.
  • Step 5. Select Tools→Boards→Wio_Tracker_LTE.
  • Step 6. Keep COM Port blank.
  • Step 7. Select Sketch→Upload to upload the code to Wio LTE Cat NB1.
  • Step 8. Press RST button to enable the COM port.

 

  • 步骤7.按RST,然后您可以看到板载RGB LED工作。
  • 3.与GNSS一起

    步骤1.将Nano SIM卡插入PCB板侧附近的Nano SIM插槽。
    步骤2.选择文件→示例→WioLTE_Cat_NB1_Arduino_Library→GNNS→GNSS草图。
    步骤3.按住Wio LTE Cat NB1背面的BOOT按钮,将USB插入PC。
    步骤4。我们将在设备管理器中看到STM BOOTLARDER。
    步骤5.选择工具→板→Wio_Tracker_LTE。
    步骤6.将COM端口保持空白。
    步骤7.选择Sketch→Upload将代码上传到Wio LTE Cat NB1。
    步骤8.按RST按钮启用COM端口。

  • #include 
    
    UBLOX_SARA_R4_GNSS gnss = UBLOX_SARA_R4_GNSS();
    
    void setup()  
    {
      // Open GNSS module
      gnss.open_GNSS();
      delay(3000);
      Serial.println("_Start");
    }
    
    void loop() {
      gnss.dataFlowMode();
    }

     

  • Step 9. Use COM monitor tools to print the serial message. Please do not use Arduino IDE COM monitor! That may cause the next time downloading fail, but reopen Arduino IDE can recover that issue. 使用COM监视工具打印串行消息。 请不要使用Arduino IDE COM显示器! 这可能导致下次下载失败,但重新打开Arduino IDE可以恢复该问题。
  • Step 10. We will see lat, lon info printed on screen.我们将在屏幕上看到lat,lon信息。
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GPGSV,1,1,01,30,,,44*7B
$GLGSV,1,1,00*65
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GPGSV,1,1,04,07,,,43,17,,,38,18,,,39,30,,,44*70
$GLGSV,1,1,00*65
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GPGSV,2,1,06,07,,,44,09,,,41,17,,,40,18,,,41*79
$GPGSV,2,2,06,28,,,40,30,,,45*73
$GLGSV,1,1,00*65
$GNGLL,,,,,,V,N*7A

4. Play with SD Card

  • Step 1. Plug micro SD card to the SD card slot.
  • Step 2. Select File→ Examples→SD→CardInfo sketch.
  • Step 3. Press and hold BOOT button at back side of the Wio LTE Cat NB1 and plug the USB to PC.
  • Step 4. We will see STM BOOTLARDER in device manager.
  • Step 5. Select Tools→Boards→Wio Tracker LTE.
  • Step 6. Keep COM Port blank.
  • Step 7. Select Sketch→Upload to upload the code to Wio_LTE.

4.使用SD卡播放

步骤1.将micro SD卡插入SD卡插槽。
步骤2.选择文件→示例→SD→CardInfo草图。
步骤3.按住Wio LTE Cat NB1背面的BOOT按钮,将USB插入PC。
步骤4.我们将在设备管理器中看到STM BOOTLARDER。
步骤5.选择工具→电路板→Wio Tracker LTE。
步骤6.将COM端口保持空白。
步骤7.选择Sketch→Upload将代码上传到Wio_LTE。

// include the SD library:
#include 

// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
const int chipSelect = 43;

void setup()
{

  Serial.print("\nInitializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin 
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
  // or the SD library functions will not work. 
  pinMode(SS, OUTPUT);


  // we'll use the initialization code from the utility libraries
  // since we're just testing if the card is working!
  while (!card.init(SPI_HALF_SPEED, chipSelect)) {
    Serial.println("initialization failed. Things to check:");
    Serial.println("* is a card is inserted?");
    Serial.println("* Is your wiring correct?");
    Serial.println("* did you change the chipSelect pin to match your shield or module?");
  } 

  // print the type of card
  Serial.print("\nCard type: ");
  switch(card.type()) {
    case SD_CARD_TYPE_SD1:
      Serial.println("SD1");
      break;
    case SD_CARD_TYPE_SD2:
      Serial.println("SD2");
      break;
    case SD_CARD_TYPE_SDHC:
      Serial.println("SDHC");
      break;
    default:
      Serial.println("Unknown");
  }

  // Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
  if (!volume.init(card)) {
    Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
    return;
  }


  // print the type and size of the first FAT-type volume
  uint32_t volumesize;
  Serial.print("\nVolume type is FAT");
  Serial.println(volume.fatType(), DEC);
  Serial.println();

  volumesize = volume.blocksPerCluster();    // clusters are collections of blocks
  volumesize *= volume.clusterCount();       // we'll have a lot of clusters
  volumesize *= 512;                            // SD card blocks are always 512 bytes
  Serial.print("Volume size (bytes): ");
  Serial.println(volumesize);
  Serial.print("Volume size (Kbytes): ");
  volumesize /= 1024;
  Serial.println(volumesize);
  Serial.print("Volume size (Mbytes): ");
  volumesize /= 1024;
  Serial.println(volumesize);


  Serial.println("\nFiles found on the card (name, date and size in bytes): ");
  root.openRoot(volume);

  // list all files in the card with date and size
  root.ls(LS_R | LS_DATE | LS_SIZE);
}


void loop(void) {

}
  • Step 8. Press RST button to enable the COM port.
  • Step 9.Use COM monitor tools to print the serial message. Please do not use Arduino IDE COM monitor! That may cause the next time downloading fail, but reopen Arduino IDE can recover that issue.
  • Step 10. Open serial monitor, we will see below info on screen.
  • 步骤8.按RST按钮启用COM端口。
    步骤9.使用COM监视工具打印串行消息。 请不要使用Arduino IDE COM显示器! 这可能导致下次下载失败,但重新打开Arduino IDE可以恢复该问题。
    步骤10.打开串口监视器,我们将在屏幕上看到以下信息。
  • Initializing SD card...
    Card type: SDHC
    
    Volume type is FAT32
    
    Volume size (bytes): 2689048576
    Volume size (Kbytes): 2626024
    Volume size (Mbytes): 2564
    
    Files found on the card (name, date and size in bytes):

    5. Play with Network RSSI

  • Step 1. Select File→ Examples→WioLTE_Cat_NB1_Arduino_Library→RSSI sketch.
  • Step 2. Press and hold BOOT button at back side of the Wio LTE Cat NB1 and plug the USB to PC.
  • Step 3. We will see STM BOOTLARDER in device manager.
  • Step 4. Select Tools→Boards→Wio_Tracker_LTE.
  • Step 5. Keep COM Port blank.
  • Step 6. Select Sketch→Upload to upload the code to Wio_LTE.

5.使用网络RSSI

步骤1.选择文件→示例→WioLTE_Cat_NB1_Arduino_Library→RSSI草图。
步骤2.按住Wio LTE Cat NB1背面的BOOT按钮,将USB插入PC。
步骤3.我们将在设备管理器中看到STM BOOTLARDER。
步骤4.选择工具→板→Wio_Tracker_LTE。
步骤5.将COM端口保持空白。
步骤6.选择Sketch→Upload将代码上传到Wio_LTE。

#include 
#include 

Ublox_sara_r4 ublox = Ublox_sara_r4();

void setup() {

  SerialDebug.println("Begin...");
  ublox.powerOn();
  while(false == ublox.Check_If_Power_On()){
    SerialDebug.println("Waitting for module to alvie...");
    delay(1000);
  }  
  SerialDebug.println("Power On O.K!");

  delay(100);
  check_with_cmd("AT+UGPIOC=23,10\r\n", "OK", CMD);
  check_with_cmd("AT+UGPIOC=16,2\r\n", "OK", CMD);
}

void loop() {
    int signal;
    if(ublox.getSignalStrength(&signal)) {
        SerialDebug.print("RSSI: ");
        SerialDebug.println(signal, DEC);
    } else {
        SerialDebug.print("Error");
    }

    delay(1000);

}
  • Step 7. Press RST, then you can see below info on screen.按RST,然后您可以在屏幕上看到以下信息。
  • AT+CSQ
    
    +CSQ: 99,99
    
    OKRSSI: 99
    
    AT+CSQ
    
    +CSQ: 99,99
    
    OKRSSI: 99
    
    AT+CSQ
    
    +CSQ: 99,99
    
    OKRSSI: 99
    
    AT+CSQ
    
    +CSQ: 99,99

    Play with Javascript¶

    Thanks to G.Williams for providing Espruino the Javascript interpreter, so that we can prototype things with Javascript.

    Update Firmware

  • Step 1: For the latest firmware, you can download from here. The firmware is named as espruino_xxx_Wio_LTE.bin.
  • Step 2: Install dfu-util, add dfu-util to PATH or Environment Variables, so that we can use it directlly in command line.
  • Step 3: Press and hold BOOT0 button before connect to computer, release after connect.
  • Step 4: The Wio LTE board will access DFU mode.
  • Step 5: In command line windows type dfu-util -d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D xxx.bin. For windows, Please enter the full path of the bin file.

配置Javascript

更新固件

步骤1:对于最新固件,您可以从此处下载。 固件名为espruino_xxx_Wio_LTE.bin。
步骤2:安装dfu-util,将dfu-util添加到PATH或环境变量,以便我们可以在命令行中直接使用它。
步骤3:在连接计算机之前按住BOOT0按钮,连接后松开。
步骤4:Wio LTE板将访问DFU模式。
步骤5:在命令行窗口中键入dfu-util -d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D xxx.bin。 对于Windows,请输入bin文件的完整路径。

1. Install Espruino web IDE

  • Step 1: Install Chrome Web Browser
  • Step 2: Click here to get Espruino Web IDE
  • Step 3: Run Espruino Web IDE from chrome's home screen or the App Launcher (type chrome://apps*at the address bar)
  • 1.安装Espruino Web IDE
  • 第1步:安装Chrome Web浏览器
    第2步:单击此处获取Espruino Web IDE
    第3步:从chrome的主屏幕或应用启动器运行Espruino Web IDE(在地址栏输入chrome:// apps *)

2. How to use Espruino Web IDE

  • Step 1: Connect the Wio LTE board to computer using a micro USB cable. On device manager you can see a new COM Port device, on MacOS it is STM32 Virtual ComPort, on windows it is STMicroelectronic Virtual COM Port.

  • Step 2: On the Web IDE click the left top icon, choose Espruino board in the select box.

2.如何使用Espruino Web IDE

步骤1:使用micro USB线将Wio LTE板连接到计算机。 在设备管理器上,您可以看到一个新的COM端口设备,在MacOS上是STM32 Virtual ComPort,在Windows上是STMicroelectronic Virtual COM Port。
步骤2:在Web IDE上单击左上方的图标,在选择框中选择Espruino board。

  • Step 3: To learn more about the IDE, please click help and then tour as below.要了解有关IDE的更多信息,请单击帮助,然后按如下所示进行浏览。

3. How to load modules

In Espruino, Modules are pieces of pre-written code (libraries) that perform common tasks, such as interfacing to different bits of hardware.

They can currently be used in a few different ways:

3.1. Espruino Web IDE

If you're using the Espruino Web IDE, simply write require("modulename") on the right-hand side - as you would have seen in the reference pages. When you click the Send to Espruino button, the Web IDE will automatically look online for minified versions of the modules you need, download them, and load them onto the board. You don't need an SD card or an internet connection to the Espruino board itself.

3.2. Load Module - the default mechanism

If you are using the Web IDE as is, the modules will be loaded from http://www.espruino.com/modules/. This URL can be changed in Web IDE settings.

To save space, most modules are provided as a minified version and the Web IDE tries to load minified versions first with default configuration.

For example, using require("ADNS5050"); will make the Web IDE loading the minified module from http://www.espruino.com/modules/ADNS5050.min.js.

3.3. Load Module from Github

For now, as you can type a URL into require, you can actually just pull a module right off GitHub:

1
require("https://github.com/espruino/EspruinoDocs/blob/master/devices/PCD8544.js");

You can even look at the history of something on GitHub, and can then require a specific version of that file with:

1
require("https://github.com/espruino/EspruinoDocs/blob/d4996cb3179abe260c030ed02bcb0d2384db6bbd/devices/PCD8544.js");

The URL comes from clicking <> by the commit you were interested in.

 

3.4. Load Module from NPM

If you activate this option in Web IDE, you can load modules from the NPM repository. Right now it:

  • only loads the latest version there.
  • only works if the module contains a single file.
  • can cause some confusion with Espruino's modules, for instance clock.

For example using require("async"); will make the Web IDE loading the tar.gz file (with automatic extraction) of the module from http://registry.npmjs.org/async.

3.5. Load Module from local folder

If you are using a local project folder, the Web IDE will automatically create an empty modules folder inside. Put a module there and you can load it with require("myCustomModule");.

With default Web IDE configuration, it will look for modules following this order:

  • local minified
  • online minified
  • local normal
  • online normal

If your own module has the same name as one of the existing ones, the Web IDE will use the minified version from online first.

If you need it anyway, you can provide a local minified version or you can change the Web IDE configuration from .min.js|.js to .js|.min.js or even myCustomModule.js|.min.js|.js to get it working.

3.6. Stand-alone Espruino

If you have an Espruino with an SD card (but you're not using the Web IDE), you can copy the modules you need into a directory called 'node_modules' on the SD card. Now, whenever you write require("modulename") the module will be used.

3.7. Internet-enabled Espruino

Right now there isn't a way to make Espruino automatically load a module from the internet when required without the Web IDE. This may be added in the future, but the fact that require is synchronous while network connections are asynchronous makes this difficult to do reliably until yield is added into the interpreter.

Until then, the following asyncronous code will dynamically load a module from the internet on demand.

 

3.如何加载模块

在Espruino中,模块是执行常见任务的预编写代码(库),例如与不同位硬件的接口。

它们目前可以通过几种不同的方式使用:

3.1。 Espruino Web IDE

如果您使用的是Espruino Web IDE,只需在右侧编写require(“modulename”) - 就像您在参考页面中看到的那样。单击“发送到Espruino”按钮时,Web IDE将自动在线查看所需模块的缩小版本,下载它们并将其加载到电路板上。您不需要SD卡或互联网连接到Espruino板本身。

3.2。加载模块 - 默认机制

如果您按原样使用Web IDE,则将从http://www.espruino.com/modules/加载模块。可以在Web IDE设置中更改此URL。

为节省空间,大多数模块都以缩小版本的形式提供,Web IDE尝试首先使用默认配置加载缩小版本。

例如,使用require(“ADNS5050”);将使Web IDE从http://www.espruino.com/modules/ADNS5050.min.js加载缩小的模块。

3.3。从Github加载模块

现在,因为你可以在require中输入一个URL,你实际上可以直接从GitHub中取出一个模块:


1

要求( “https://github.com/espruino/EspruinoDocs/blob/master/devices/PCD8544.js”);
您甚至可以在GitHub上查看某些内容的历史记录,然后可以要求该文件的特定版本:

1

要求( “https://github.com/espruino/EspruinoDocs/blob/d4996cb3179abe260c030ed02bcb0d2384db6bbd/devices/PCD8544.js”);
该URL来自您感兴趣的提交单击<>。
3.4。从NPM加载模块

如果在Web IDE中激活此选项,则可以从NPM存储库加载模块。现在它:

只在那里加载最新版本。
仅在模块包含单个文件时才有效。
可能会导致与Espruino的模块混淆,例如时钟。
例如使用require(“async”);将使Web IDE从http://registry.npmjs.org/async加载模块的tar.gz文件(自动提取)。

3.5。从本地文件夹加载模块

如果您使用的是本地项目文件夹,Web IDE将自动在其中创建一个空模块文件夹。在那里放一个模块,你可以用require(“myCustomModule”);加载它。

使用默认的Web IDE配置,它将按照以下顺序查找模块:

当地的缩小
在线缩小
当地正常
在线正常
如果您自己的模块与现有模块具有相同的名称,则Web IDE将首先使用在线缩小版本。

如果您还需要它,您可以提供本地缩小版本,或者您可以将Web IDE配置从.min.js | .js更改为.js | .min.js甚至myCustomModule.js | .min.js | .js让它工作。

3.6。独立的Espruino

如果您有带SD卡的Espruino(但您没有使用Web IDE),则可以将所需的模块复制到SD卡上名为“node_modules”的目录中。现在,无论何时编写require(“modulename”),都将使用该模块。

3.7。支持互联网的Espruino

现在没有办法让Espruino在没有Web IDE的情况下在需要时自动从互联网加载模块。这可以在将来添加,但是需要是同步的,而网络连接是异步的这一事实使得难以可靠地执行,直到将yield添加到解释器中。

在此之前,以下异步代码将根据需要从Internet动态加载模块。

function loadModule(moduleName, callback) {
  require("http").get("http://www.espruino.com/modules/"+moduleName+".js", function(res) {
    var contents = "";
    res.on('data', function(data) { contents += data; });
    res.on('close', function() {
      Modules.addCached(moduleName, contents);
      if (callback) callback();
    });
  }).on('error', function(e) {
    console.log("ERROR", e);
  });
}

4. Play with Onboard RGB LED

  • Step 1. Config the R, G, B numbers, the arrange is 0~255.
  • Step 2. Copy the code to IDE and upload to board.
  • Step 3. The on board RBG LED will be turned on.

4.使用板载RGB LED播放

步骤1.配置R,G,B编号,排列为0~255。
步骤2.将代码复制到IDE并上传到电路板。
步骤3.板载RBG LED将亮起。

WioLTE.setLEDPower(true);
WioLTE.LED(r,g,b); // please modify the RGB to values with range 0..255)


// Dynamic colors show
WioLTE.setLEDPower(true);

var rgb = new Uint8ClampedArray(3);
var pos = 0;
function getPattern() {
  pos++;
  for (var i=0;i

5. Play with SD Card

Note

Epruino firmware v1.94 is not support SD card drive, please use v1.96 or later, the latest version is v1.99.

  • Step 1. Plug a micro SD card to the card slot, please format the SD card as FAT32.
  • Step 2. Copy the code to Espruino IDE and upload it.

5.使用SD卡播放

注意
Epruino固件v1.94不支持SD卡驱动,请使用v1.96或更高版本,最新版本为v1.99。
步骤1.将micro SD卡插入卡槽,请将SD卡格式化为FAT32。
步骤2.将代码复制到Espruino IDE并上传。

var fs = require('fs');

// Init SDCard
WioLTE.init;

// List files
console.log('List files on root path:\r\n', fs.readdirSync());
// Write file  
fs.writeFileSync("hello.txt", "Hello World");
// read file
console.log(fs.readFileSync("hello.txt"));
// append file
fs.appendFileSync("hello.txt", "!!!");
// read again
console.log(fs.readFileSync("hello.txt"));

6. Play with Grove Module

6.1. Play with Digital Ports 6.1.1 Grove-Button (Input) - Step 1. Conenct Grove-Button to Wio LTE D38 port. - Step 2. Copy the code to IDE and upload to board. - Step 3. We will see the "Pressed" when we press the button. Or else, we will see "Released" printed on screen.

6.与Grove模块一起玩

6.1。 使用数字端口6.1.1 Grove-Button(输入) - 步骤1.将Grove-Button连接到Wio LTE D38端口。 - 步骤2.将代码复制到IDE并上传到电路板。 - 步骤3.当我们按下按钮时,我们将看到“按下”。 否则,我们会在屏幕上看到“已发布”。

WioLTE.setGrovePower(true);
var button = new (require("GroveButton"))(WioLTE.D38, function(e) {
  if (e.state) console.log("Pressed");
  else console.log("Released");
});

6.1.2 Grove-Ralay (Output) - Step 1. Conenct Grove-Ralay to Wio LTE D38 port. - Step 2. Copy the code to IDE and upload to board. - Step 3. We will hear the Relay switch and see the "Done" printed on screen.

6.1.2 Grove-Ralay(输出) - 步骤1.将Grove-Ralay连接到Wio LTE D38端口。 - 步骤2.将代码复制到IDE并上传到电路板。 - 步骤3.我们将听到继电器开关并看到屏幕上打印的“完成”。

WioLTE.setGrovePower(true);
var relay = new (require('GroveRelay'))(WioLTE.D38);
setInterval(function() {
  relay.off();
  relay.pulse(1000, function() {
    console.log("Done!");
});
}, 2000);

6.2. Play with Analog Ports

  • Step 1. Conenct Grove-Light Sensor to Wio LTE A4 port.
  • Step 2. Copy the code to IDE and upload to board.
  • Step 3. We will see the numbers printed on screen.

6.2。 玩模拟端口

步骤1.将Grove-Light传感器连接到Wio LTE A4端口。
步骤2.将代码复制到IDE并上传到电路板。
第3步。我们将在屏幕上看到数字。

WioLTE.setGrovePower(true);
var light = new (require('GroveLightSensor'))(WioLTE.A4);
setInterval(function() {
  console.log(light.read());
}, 500);

6.3. Play with UART Ports

  • Step 1. Conenct Grove-GPS to Wio LTE UART port.
  • Step 2. Copy the code to IDE and upload to board.

6.3。 使用UART端口

步骤1.将Grove-GPS连接到Wio LTE UART端口。
步骤2.将代码复制到IDE并上传到电路板。

WioLTE.setGrovePower(true);
Serial1.setup(9600,{tx:WioLTE.UART[1],rx:WioLTE.UART[0]});
var gps = new (require('GPS')).connect(Serial1, function(data) {
  console.log(data);
});

Step 3. We will see time, lat, lon, satellites and altitude info printed on screen as below.

步骤3.我们将在屏幕上看到时间,纬度,经度,卫星和高度信息,如下所示。

{  "time": "09:35:02", "lat": 30.69766, "lon": 104.05367833333, "fix": 1, "satellites": 6, "altitude": 537.2 }
{  "time": "09:35:03", "lat": 30.69765166666, "lon": 104.05366166666, "fix": 1, "satellites": 6, "altitude": 537.2 }
{  "time": "09:35:04", "lat": 30.69765, "lon": 104.05363833333, "fix": 1, "satellites": 6, "altitude": 537.1 }

6.4. Play with I2C Ports

  • Step 1. Conenct Grove 3-Axis Digital Accerlerometer(±16g) to Wio LTE I2C port.
  • Step 2. Copy the code to IDE and upload to board.

6.4。 使用I2C端口
步骤1.将Grove 3轴数字加速度计(±16g)连接到Wio LTE I2C端口。
步骤2.将代码复制到IDE并上传到电路板。

WioLTE.setGrovePower(true);
I2C1.setup({scl:WioLTE.I2C[0], sda:WioLTE.I2C[1]});
var accel = require("ADXL345").connect(I2C1,0,0);
accel.measure(true);
setInterval(function(){
  console.log(accel.read());
},2000);

 Step 3. We will see x, y and z info printed on screen as below.第3步。我们将在屏幕上看到x,y和z信息,如下所示。

{ "x": -0.05859375, "y": -0.46484375, "z": 0.76953125 }
{ "x": -0.0546875, "y": -0.46484375, "z": 0.765625 }
{ "x": -0.0546875, "y": -0.46875, "z": 0.7578125 }
{ "x": -0.05078125, "y": -0.47265625, "z": 0.765625 }
{ "x": -0.0546875, "y": -0.46484375, "z": 0.77734375 }
{ "x": -0.0546875, "y": -0.46875, "z": 0.765625 }
{ "x": -0.0546875, "y": -0.46875, "z": 0.765625 }
{ "x": -0.05078125, "y": -0.47265625, "z": 0.765625 }

6.5 Javascript APIs

For more info, please refer to Wio_LTE_Module

  • debug(boolean, boolean) - choose debug level
  • reset(callback) - Reset LTE
  • init(callback) - Initialise LTE
  • getVersion(callback) - returns LTE firmware version
  • connect(apn, username, password, callback) - Connect to mobile network
  • getVersion(callback) - returns current version
  • getIP(callback) - Get current IP address
  • geoLocStart(period_in_milliseconds) - Start getting geolocation data
  • geoLocStop() - Stop getting geolocation data
  • geoLocGet(callback) - Get last location
  • geoLocConvert(callback(err,latlong)) - Get last location as latitude/longitude
  • board.SMS - SMS functionality with init/read/send/list/delete functions based on the [[ATSMS]] module
  • board.Call, with:
  • call(number, callback)
  • answer(callback)
  • hangup(callback)
  • handleRing(boolean) - if trie, will call any function added with board.on('RING', ...)
  • sleep(callback) - LTE modem get into sleep mode, it can save about 100mA
  • wake(callback) - LTE modem wake up from sleep mode

6.5 Javascript API

有关详细信息,请参阅Wio_LTE_Module

debug(boolean,boolean) - 选择调试级别
重置(回调) - 重置LTE
init(回调) - 初始化LTE
getVersion(callback) - 返回LTE固件版本
connect(apn,username,password,callback) - 连接到移动网络
getVersion(callback) - 返回当前版本
getIP(回调) - 获取当前的IP地址
geoLocStart(period_in_milliseconds) - 开始获取地理位置数据
geoLocStop() - 停止获取地理位置数据
geoLocGet(回调) - 获取最后位置
geoLocConvert(callback(err,latlong)) - 获取纬度/经度的最后位置
board.SMS - 基于[[ATSMS]]模块的具有init / read / send / list / delete功能的SMS功能
board.Call,有:
电话(号码,回拨)
应答(回调)
挂断(回调)
handleRing(boolean) - 如果是trie,将调用随board.on添加的任何函数('RING',...)
睡眠(回调) - LTE调制解调器进入睡眠模式,它可以节省大约100mA
唤醒(回调) - LTE调制解调器从睡眠模式唤醒

 

你可能感兴趣的:(IoT,IoT)