Giter VIP home page Giter VIP logo

rakwireless / wisblock Goto Github PK

View Code? Open in Web Editor NEW
150.0 17.0 118.0 158.19 MB

Quickstart, tutorials and examples for the RAKwireless WisBlock product line.

Home Page: https://www.rakwireless.com

License: MIT License

C++ 0.53% C 94.30% Makefile 0.50% Assembly 3.70% CSS 0.07% HTML 0.13% Batchfile 0.01% Shell 0.03% CMake 0.12% JavaScript 0.24% Python 0.37%
wisblock wisblock-base wisblock-core wisblock-sensor wisblock-io lora lorawan nrf52 sx1262

wisblock's Introduction

RAKwireless WisBlock

Modules Modules Build Status
Modules Modules Modules

Introduction

WisBlock is an amazing product built by the RAK company for IoT industry. It can build circuits like clicking blocks together to quickly realize your idea.

WisBlock consists of WisBlock Base, WisBlock Core, WisBlock Sensor and WisBlock IO.

  • WisBlock Base → the block that the whole system is build on.
  • WisBlock Core → the processing unit with the micro-controller.
  • WisBlock Sensor → the blocks with variety of sensors.
  • WisBlock IO → the blocks that extend the communication options and interfacing capabilities of the WisBlock.

WisBlock-Assembly

This repository is created to help you start with WisBlock as simple as possible. Let's get started.

RAKwireless invests time and resources providing this open source code, please support RAKwireless and open-source hardware by purchasing products from RAKwireless!

For support and questions about RAKwireless products please visit our forum

To buy WisBlock modules please visit our online store


Where to find what


Documentation


Examples







Overview

WisBlock is a modular Plug&Play system. Compared with other systems (Arduino, Raspberry Pi, M5Stack), it has several advantages:

  1. Using a compact connector makes its size very small. A WisBlock Base board, which is the base carrier, is only 30mm by 60mm in size. One WisBlock Base can hold one micro-controller module (WisBlock Core), one IO module (WisBlock IO) and up to 4 sensor modules (WisBlock Sensor).

  2. Using an industrial rated connector enables you to use the same modules from rapid prototyping to testing to final product.

  3. WisBlock is not only modular on hardware base. With ready to use software blocks, it is simple to create an application to match your implementation requirements.


Modularity

Base board

WisBlock Base is the base board that makes flexibility and modularity possible.

Plug&Play hardware modules

WisBlock Core → processing block with LoRa/LoRaWan, WiFi or BLE connectivity.
WisBlock Sensor → wide range of sensor blocks.
WisBlock IO → blocks for user interfaces, custom sensor connections and actuators.

Plug&Play software modules

Using Arduino framework, WisBlock provides a free and widely available programming environment:

  • Open Source libraries for communication protocols
  • Open Source libraries for data processing
  • Open Source libraries for sensors input
  • Open Source libraries for actuators
  • Open Source libraries for user interfaces

WisBlock Base

WisBlock is build up on a WisBlock Base board. It is a platform carrier that allows easy plug-in of one WisBlock Core processing board, one WisBlock IO interface board and up to four WisBlock Sensor boards.

WisBlock Base is providing the power supply, battery and solar panel connections and charging block. In addition it has connectors for programming and debugging.

During development phase, WisBlock Base allows you to quickly switch between microcontrollers, IO functionality and sensors by simply changing the modules.

Repairs and upgrades are easy with WisBlock Base on your final product, because modules can be changed with just Plug'n'Play.

For controlling and limiting power consumption of your IoT solution, WisBlock Base enables to control the power supply for the WisBlock Sensor and WisBlock IO modules, limiting the power consumption by switching off these modules if they are not needed.


WisBlock Core

WisBlock Core is the processing unit of your IoT solution.

Select the processing power based on the requirements of your application from a range of processing boards which starts with low single core to high dual core processing power units are available.

All of them communication capability, some of them offer in addition LoRa/LoRaWAN, WiFi, Bluetooth or Bluetooth Low Energy. All are designed for battery optimized low power consumption.


WisBlock Sensor

A range of sensors for sensing environmental conditions (temperature, humidity, …), location and movement conditions (GNSS/GPS, accelerometer, …) that you just plug into WisBlock Base makes it easy to complete your application with the required sensors.


WisBlock IO

WisBlock IO extensions provide your application with interfaces that are not covered by WisBlock Core or WisBlock Sensor blocks.
This includes

  • user interfaces like
    • keyboards
    • buttons
    • displays
  • communication interfaces like
    • 0~5V
    • 4-20mA
    • I2C
    • RS232
    • RS485
    • many more
  • alternative power supplies like
    • 24V
    • POE

wisblock's People

Contributors

alphacentauri82 avatar beegee-tokyo avatar carlrakwireless avatar cjay-mendoza avatar johansmacias avatar kongduino avatar msam-rak avatar neykov avatar rakwireless-rommel avatar rallyuminga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wisblock's Issues

Rak11300 - Error while uploading the sketch

[Linux]

I'm having the error "An error occurred while uploading the sketch" every time I try to upload a sketch to my Rak11300.
I have "show verbose output during: compilation and upload" but no further info are displayed.

This happens with all the examples and even using an empty "new project".

I've followed this guide https://docs.rakwireless.com/Knowledge-Hub/Learn/Installation-of-Board-Support-Package-in-Arduino-IDE/ and also tried to update the firmware as suggested there.

Any suggestion? What can I do?

I'm using Arduino IDE but also tried using Platform IO.

[Windows]
Fixed the issue by manually run post_install.bat

CS Pin for selecting SPI Slave Device?

Hello,
im trying to communicate with two SPI Devices on a DualIO Base Board but im wondering that the CS-Pin is connected on the same IO Pin. So i have no chance to select the slave device before i begin to communciate.

Is there any other way to select the right device before i start to communicate?

Parts:

  • RAK19001 WisBlock Dual IO Base Board
  • RAK13006 WisBlock CAN Module
  • RAK13300 WisBlock LPWAN Wireless Module

image

Thanks for help and regards
Andre

Decrypted LoRa data appears corrupted?

Hi,

I'm using this sketch to push data to Chirpstack v4. It seems the data is getting corrupted on the way through? The payload looks okay:

data:"AQfoFWoAAXMuAABExw=="

but when I try and parse it, I get:

data:"��è�j�s.DÇ"

Not sure how to troubleshoot this?

What is the licence requirement for this code?

Hey Rak, This looks like a good API for use developers.
Is the code copyright? How can we use/sell devices with this code?
If we need a license please can you tell us how to get that?
Best Wishes

Rak11300 - OTAA join failed!

I'm trying to run the LoRaWAN_OTAA_ABP example for the Rak11300 core.

I'm getting the following error:

12:32:48.121 -> =====================================
12:32:48.121 -> Welcome to RAK11300 LoRaWan!!!
12:32:48.121 -> Type: OTAA
12:32:48.121 -> Region: EU868
12:32:48.121 -> =====================================
12:33:16.042 -> OTAA join failed!
12:33:16.042 -> Check your EUI's and Keys's!
12:33:16.042 -> Check if a Gateway is in range!

Check your EUI's and Keys's!: EUI and Keys are correct.
Check if a Gateway is in range!: The Gateway is 1meter from the device.

I've registred the device on the helium console and I receive 3 Join Request replied with 3 Join Accept.
Here is a screenshot: https://imgur.com/gallery/PExIFE6.

Note:
I've also tried the example LoRaWAN_OTAA_ABP example for the Rak4631 core. In this case I have no problem. Everything works fine and I receive packets succesfully.

If you need more info let me know.

RS485 in DeepSleep

In the low power documentation it is stated that SerialUSB can not be used, as that will cause a FreeRTOS task to always run and prevent the microcontroller from sleeping.
See docs: https://github.com/RAKWireless/WisBlock/blob/master/examples/communications/LoRa/LoRaWAN/Low_Power_Example.md#code-explanation

I would like to read out a sensor over RS485, for which one of the HardwareSerial ports are initialised. What I do is:

  • Tast wakes up
  • RS485.begin()
  • Read sensor and transmit LoRa
  • RS485.end()
  • Task sleeps/blocks

It seems like the RS485/HardwareSerial is doing the same as the documentation says for the SerialUSB - a always running task. Power usage with the RS485 code included makes the Wisblock use just below 1mA when I'm expecting it to sleep. Without the RS485 code the current usage is around 27uA during the expected sleep times.

Can we somehow change the way serial ports are handled, so that the Wisblock can go into deep sleep, even when RS485 or SerialUSB is used?

I would preferable also want to use hardware Serial1 (TX1, RX1 on J10) for debugging, as when I power my board from the Otii current sensor, I want to capture logs of what the Wisblock is doing, without powering the board over USB.

Reset

Hi, I have a issue, when I try to start this example, I always have to push the button reset. And i would like that i don't need to push that button to start working. Because it is going to be an autonomous GPS.
Thank you.

Battery level code uses too short sample (TACQ) time

In examples/RAK4630/power/RAK4630_Battery_Level_Detect/Read_Battery_Level)/Read_Battery_Level.ino the output of
the ADC for battery sense is multiplied by a mysterious number that's commented as depending on the board:

image

I'd expect the conversion of ADC value to be: ADC_Value * VBAT_MV_PER_LSB * DIVIDER_FACTOR, where DIVIDER_FACTOR is 1 / 0.6 -> 1.6666667 (aka 5/3).

But there's this magical 1.73 instead of the expected 1.666667. I'm guessing when this code was written, this conversion was reliably giving a slightly too-low value of battery voltage - so the developer externally measured the battery voltage and calculated the 1.73 factor.

The actual problem here is that the ADC is not initialized correctly for the high series resistance of the battery divider (600k). Using the spec of 2.5pF (typical) input capacitance to the ADC with 600k gives an RC time of 1.5uS. The default sample time is 3uS, so the sample capacitor does not completely charge in 2 * RC, thus resulting in too low measurements. The minimum sample time is 5 * RC and it doesn't hurt to go longer. (see https://www.electronics-tutorials.ws/rc/rc_1.html for details of RC time constants).

Given that ADC sample capacitor value will vary from part to part, this introduces a source of inaccuracy.

Suggest initializing the SAADC to a minimum of 10uS sample time and correcting the ADC conversion math.

I've tested with 40uS sample time and correct conversion math and see 0.3% error against externally measured.

Deep Sleep example without LoRa

I was trying to test Deep Sleep on the Wisblock RAK4631. The only way to get the power usage down to 24uA is to initialise LoRa and LoRaWAN. Is there a way to switch everything off without having to enable the full LoRa stack?

A low power example without LoRa would be very useful.

File Not found when I try to patch platformio

C:\Users\gabri.platformio\RAK_PATCH>python ./rak_patch.py
Patching RAK4631
Patched RAK4631
Patching RAK11200
Patched RAK11200
Patching RAK11310
File not found.
Traceback (most recent call last):
File "C:\Users\gabri.platformio\RAK_PATCH\rak_patch.py", line 66, in
copy_files_ext(src_dir1, src_dir2, src_dir3, dest_dir1, dest_dir2, dest_dir3, "RAK11310")
File "C:\Users\gabri.platformio\RAK_PATCH\rak_patch.py", line 27, in copy_files_ext
shutil.copyfile(src_3+"/Print.h", dest_3+"/Print.h")
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 256, in copyfile
with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '../packages/framework-arduino-mbed/cores/arduino/api/Print.h'

Document how to upgrade bootloader if BLE OTA fails

In file
https://github.com/RAKWireless/WisBlock/blob/master/bootloader/RAK4630/new/README.md

I would like to see the alternative bootloader upgrade steps listed:

https://forum.rakwireless.com/t/bootloader-fails-to-upgrade-via-ble/4193/3

https://forum.rakwireless.com/t/bootloader-fails-to-upgrade-via-ble/4193/4

Currently information on the Wisblock is very spread out in different locations: Forum, docs, readmes. This makes it very difficult for users to know where to go looking if they have a problem. I'd suggest using the README.md files as primary source, building the docs from them. If a question is answered on the forum, that answer should be included in the readmes.

Re-Join Network

I'd like to try join the network until a gateway is found.

Here is described that the JOINREQ_NBTRIALS parameter can be used to specify a "...number to set the number of trials to join the network".

But how to join the network "for ever". Should I set a very high number? Is there a max value for that parameter? Otherwise, is there a way to set something like: "try join until you join".

Any suggestion?
Thank you

use releases for bootloaders?

Looking at the download https://github.com/RAKWireless/WisBlock/blob/master/bootloader/RAK4630/Latest/WisCore_RAK4631_Board_Bootloader.zip

from the https://github.com/RAKWireless/WisBlock/tree/master/bootloader/RAK4630 page.

Perhaps that zip file should be pushed to a release?

If the CI cannot build them (due to some internal reason, you can always create a release manually and push the files into it). If you do have the steps, but need help adding them to your CI, share the steps, and I'll see if I can help adding it.

I'm planning on consuming that Bootloader in the meshtastic-flasher tool ( see https://github.com/meshtastic/Meshtastic-gui-installer ) and I'd prefer having a stable endpoint with version. In other words, I'd like to know that bootloader release 1.2.3 has a date of xxx and SoftDevice version yyy when I query the INFO_UF2.TXT file.

Issue with the region.

Hi, I just purchase this kit 2 and I want to do the example, but I do not know why always it start as a European model, I bought the American model, I do not where it changes or if RAK gave me a different model.
Captura

Revert Change to MTU Size

@beegee-tokyo Okay, I think these changes that were recommended in #65 and added in commit adbeffe can be reverted. Based on my testing it's probably a better experience if it is. It appears that Nordic has improved their apps to better handle legacy and secure boot loaders so that this change seems to be no longer necessary.

I've been testing with two devices. One is running 0.4.2 bootloader and the other is running 0.4.3. I find performance is actually better on bootloader 0.4.2. 0.4.3 is now requiring setting PRN to on and turning the packet count to a very low number which is really slow. Whereas with 0.4.3 I can use the stock settings of the DFU app without issue and it runs 2-3x faster.

Receive Data

LoRaWan communications.

How to receive data instead of send?
In the examples folder there are examples about how to send data from a device to a server. But how to handle data received from a server? In particular I’m sending data through the helium console “downlink” tool.

Lorawan Example does not work in Platform IO

It seems the platform IO implementation does not support printf as used in the adruino example:

src/main.cpp:22:10: error: 'class arduino::UART' has no member named 'printf'; did you mean 'print'?

RAK14001 - Current question

Documentation notes that the RAK14001 current range is 1-31. Are there any possible unexpected behaviors to setting it above 31? Curious about safety.

OTAA JOIN FAILED ON RAK4631

Hello I get this error
I dont now why ?
Is problem on chirpstack or node ?
bc8432b805967d82552804397454e6588cd1b789

image

uint8_t nodeDeviceEUI[8] = {0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x33, 0x33};
uint8_t nodeAppEUI[8] = {0xB8, 0x27, 0xEB, 0xFF, 0xFE, 0x39, 0x00, 0x00};
uint8_t nodeAppKey[16] = {0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88};

USB Serial Issues

Hope all is well,

I have noticed strange behavior when using USB serial with the wisblocks, if I don't send a serial message in quick enough intervals from the wisblock to my machine, the connection drops, then eventually there is a reset. I have the following video showing a basic demo to show the specific issue. If I dont have USB connected and have it break out of the while(!Serial) after a few seconds to run on a battery, there is no issue and it never resets even if it prints to serial during operation.

I have noticed this issue since I started using the wisblocks in the past week, but I was able to get around the issue by printing a UTF-8 blank character every few hundred milliseconds. I noticed that if I send serial data to the device, it seems like a buffer on the device side empties as shown in this video. If I need to update something, let me know, I have not noticed this issue with any other device on my desktop.

Setup

  • System (uname -a) - Linux manjaro-tank 5.10.23-1-MANJARO
  • Framework - PlatformIO w/ Arduino using the getting started guide in this repo

Demo Code

#include <Arduino.h>

// Value of 300ms is OK, 3 or 30 seconds not so much
#define INTERVAL 3000

unsigned long next = 0;
unsigned i = 0;

void setup() {
  pinMode(LED_BLUE, OUTPUT);
  digitalWrite(LED_BLUE, HIGH);
  Serial.begin(9600);
  while(!Serial) {
    // Need otherwise serial port is lost if I dont get to it fast enough
    Serial.println(); 
  }
  Serial.println("Hello! I'm starting now");
  digitalWrite(LED_BLUE, LOW);
}

void loop() {
  // Delays also have the same effect, I wanted any possible hidden timer or rtos setup to not be hindered
  if(millis()>=next) {
    digitalWrite(LED_BLUE, HIGH);
    Serial.print("Printing to usb serial ");
    Serial.println(i++);
    // So I can see the led with my human eyeballs
    delay(10); 
    digitalWrite(LED_BLUE, LOW);
    next = INTERVAL + millis();
  } 
}

any tutorials on setting up these oled displays on the rak wisblock

im trying to get into the rak wisblock for a p2p messenger but my bootloader is outdated and i cant find any that have an oled display. i bought the developer kit and a few oled displays off ebay but cant find any info on how to properly install them. any help would be greatly appreciated. i am novice to this but am very interested and i dont know how to code but have installed arduino trying to follow these tutorials but need help. dont bash me too hard!

in bootloader mode, the RAK4631 5005 and 19003 have same values

The vendor id and the product are the same when both devices are in boot mode.

Is there a way to distinguish the two devices without installing any big libraries? (currently using python, so a pip package would be fine as long as it works on mac, windows, and linux.

I would love to have a way to easily query the device for what model it is. They do have different product identifiers when not in boot mode.

I'm using lsusb in linux to query. If on a mac, you can use: ioreg -p IOUSB. On windows, Get-PnpDevice -PresentOnly. I typically will run those commands to a file before plugging in the device, then plug in the device, and do a "diff".

Let me know you need more info or do not understand my question.

LoRa P2P RX and TX Radio init, in examples, passes a numeric value, not a boolean causing interop problems

In both LoRa P2p RX and TX examples, one of the passed initialization values should be passed as bool, not numeric, as the example currently shows.
// Set Radio RX configuration
Radio.SetRxConfig(MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR,
LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH,
LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON,
0, true, 0, 0, LORA_IQ_INVERSION_ON, true);
Here, bool freqHopOn is coded as 0, not bool, as it should be. This was uncovered during an attempt to communicate with an SX1276 module, and making this correction resolved communications. The P2P TX example is also incorrect.

void (*SetRxConfig)(RadioModems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
uint32_t bandwidthAfc, uint16_t preambleLen,
uint16_t symbTimeout, bool fixLen,
uint8_t payloadLen,
bool crcOn, bool freqHopOn, uint8_t hopPeriod,
bool iqInverted, bool rxContinuous);

LoRaP2P example not working

My setup:

  • Arduino IDE
  • 2x WisBlock Base Board 2nd Gen, RAK19007; RAK SKU: 110082; product link
  • 2x Nordic nRF52840 BLE Core Module for LoRaWAN with LoRa SX1262 (RAK4631); RAK SKU: 116008; product link
  • Connecting via USB for programming (had to first install bootloader on both units via RAKDAP1 module)

Notes:

  • Code is being used as is from this github project posted by: @beegee-tokyo
  • Project compiles and loads fine. No errors or warnings
  • Serial console in Arduino IDE hears TX/RX timeouts fine (ie: the command Serial.println("OnRxTimeout"); works).
  • Various test codes work (additional Serial.println commands put in place to ensure all code was running; LED control on baseboard)
  • All hardware is assembled correctly with antennas as far as I can tell (10+ years working with stuff similar to this - pretty sure I have it all setup correctly)
  • I've read through all posted issues. I didn't see anything specific to my issue.

Issue: no reception of packets by RX unit. The only message rx'd on the Arduino IDE serial terminal of the RX board are the init messages and the OnRxTimeout messages. I've also verified that the OnTxDone() function is running in the TX project via Serial.println() commands.

Right now, I'm just trying to get a TX/RX example working so I can do some range testing. I note that the hardware I'm using doesn't exactly match the recommended HW but it seems like it should be compatible from what I understand. I'm sure I'm missing something though.

I can post the compiler outputs for both projects if needed.

Any thoughts on what might be going on here would be very much appreciated.

Thanks!

Buffer Modulation

Hey RAK, I was wondering that can I send JSON data or some other type of data to gateway via LoRaWAN OTAA, where I can go:

'temperature': 23

or

buffer[i++] = "Temp"; //Which is not possible as it is an unsigned int array
buffer[i++] = 23;

or send it in buffer but I don't want to hardcode it, Thanks for the help!

Gps Tracker example Problem! "check acc"

Hi I was trying this code and following all the doc I ran into a break in the code the moment before I print the axis data, I am left with "check acc" in the console and it all jams and the console freezes. help me? Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.