Giter Site home page Giter Site logo

io_wssfm10-arduino's Introduction

IoThings Arduino Library for Wisol WSSFM10 Module

Here is all the code you need to use this module

Feel free to fork, or submit any improvements via a pull request

Usage

Pin connection

SNOC-BRKWS01 pinout Connect breakout board to the Arduino as this:

  • Board -> Arduino
  • 3,3V -> 3,3V
  • GND -> GND
  • RX -> 11
  • TX -> 10

Example

Just run the example sketch.

io_wssfm10-arduino's People

Contributors

adrien3d avatar nimasaj avatar per1234 avatar savjee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

io_wssfm10-arduino's Issues

issue sendReceive

When I use this command:

bool statusSR = mySigfox.sendReceive(&p, sizeof(p), valor_recibido);

I get this response

image

But program gets frozen at this point when sigfox backend is ok

image

Same hapen using sendReceiveString

every try I did happens the same

Setting transmission power

Could you please add support to adjust transmission power?

Description is available in pages 8 (table 7) and 12 (table 10) of datasheet.
The output power of the AX−Sigfox can be programmed in 1 dB steps from 0 dBm – 14 dBm.

Datasheet: https://www.onsemi.com/pub/Collateral/AX-SIGFOX-D.PDF

Table 7:

Description Command Tx power
PTXmin Lowest Transmitter output power AT$CW=868130000,1,0 0 dBm
PTXmax Highest Transmitter output power AT$CW=868130000,1,14 14 dBm

Table 10:

Name Range Description
Frequency 800000000−999999999, 0 Continuous wave frequency in Hz. Use 868130000 for Sigfox or 0 to keep previous frequency
Mode 0, 1 Enable or disable carrier wave.
Power 0−14 dBm of signal | Default: 14

Issue with values<=0xF in messages

There is a problem either in parsing in Sigfox module, or in the way data is sent to the Sigfox module. If you send a message in an array like following:

uint8_t msg[12];
msg[0]=76; //0x4C
msg[1]=20; //0x14
msg[2]=13; //0xD
//complete example below//

there would be a parsing error produced and your message will not be sent to Sigfox servers, due to msg[2]=13; //0xD. If you change it to msg[2]=16; //0x10 the issue will be resolved. It seems that this part is seen as a nibble instead of a byte, as long as the value is equal or less than F in HEX. The complete and simple example is as below.

#include <SoftwareSerial.h>

#define SF_rxPin 5     //Sigfox
#define SF_txPin 6     //Sigfox
boolean debug =  true;
uint8_t msg[12];

SoftwareSerial Sigfox =  SoftwareSerial(SF_rxPin, SF_txPin);  //((Module.Tx>>>MCU.Rx), (Module.Rx>>>MCU.Tx))


void setup() {
  pinMode(SF_rxPin, INPUT);
  pinMode(SF_txPin, OUTPUT);  
  if(debug){
    Serial.begin(9600);
  }
  Sigfox.begin(9600);
  delay(500);
  if(debug){
  Serial.println("Hello!");
  }  
}

void loop() {
  msg[0]=76; //0x4C
  msg[1]=20; //0x14
  msg[2]=13; //0xD
  if(debug){
    Serial.println(msg[0],HEX);
    Serial.println(msg[1],HEX);
    Serial.println(msg[2],HEX);
  }
  delay(20);

  sendMessage(msg, strlen(msg)); // Sending messages here
  delay(20*1000);
}

//Send Sigfox Message
void sendMessage(uint8_t msg[], int size){

  String status = "";
  char output;
  Sigfox.print("AT$SF=");
  for(uint8_t i= 0;i<size;i++){
    Sigfox.print(String(msg[i], HEX));
    if(debug){
      Serial.print("Byte:");
      Serial.println(msg[i], HEX);
    }
  }

  Sigfox.print("\n");

  while (!Sigfox.available()){
     //blink();
  }
  while(Sigfox.available()){
    output = (char)Sigfox.read();
    status += output;
    delay(10);
  }
  if(debug){
    Serial.println();
    Serial.print("Status \t");
    Serial.println(status);
  }
}

I also tried with the following message structure and nothing changed. The issue still exists.

#include <SoftwareSerial.h>

#define SF_rxPin 5     //Sigfox
#define SF_txPin 6     //Sigfox
boolean debug =  true;

SoftwareSerial Sigfox =  SoftwareSerial(SF_rxPin, SF_txPin);  //((Module.Tx>>>MCU.Rx), (Module.Rx>>>MCU.Tx))

typedef struct {
  uint8_t A;  //Value 1
  uint16_t B; //Value 2
} SigfoxMessage;
SigfoxMessage M;


void setup() {
  pinMode(SF_rxPin, INPUT);
  pinMode(SF_txPin, OUTPUT);  
  if(debug){
    Serial.begin(9600);
  }
  Sigfox.begin(9600);
  delay(500);
  if(debug){
  Serial.println("Hello!");
  }  
}

void loop() {
  M.A=76; //0x4C
  M.B=333; //0x14D
  if (debug) {
    Serial.println("Value1: "+String(M.A));
    Serial.println("Value2: "+String(M.B)+"\n");        
  }
  delay(20);
  send(&M, sizeof(M)); // Sending messages here
  delay(20*1000);
}

void send(const void* data, uint8_t size){
  uint8_t* bytes = (uint8_t*)data;
  if(debug){
    Serial.println("Message Size: " + String(size));
  }
  Sigfox.print("AT$SF=");
  for(uint8_t i= 0; i<(size); ++i){
    Sigfox.print(bytes[i], HEX);
    if(debug){
      Serial.print("Byte:");
      Serial.println(bytes[i], HEX);
    }
  }
  Sigfox.print("\n");//// \n or \r
}

In this way there is a limitation in sending different values and as long as the value is <= 0xF, there would be a problem.
Is there a fix for this issue?

Footprint/Eagle files of WSSFM10R1 or WSSFM11R2D or BRKWS01

Is there any footprint for WSSFM10R1 or WSSFM11R2D? Or Eagle files related to breakout board (BRKWS01)?

Since there is no breakout board for WSSFM11R2D on Yadom, I would like to make it myself. Therefore, I would be thankful if you share design (Eagle) files for BRKWS01.

Thanks

ESP32 module compatibility.

Hello, Adrien.
I would like to know if there is any easy way to enable SIGFOX module communication with ESP32 module, instead of arduino.
The only difference is that I in ESP32 use the "HardwareSerial" to communicate with the other modules using UART. is it possible?

Thanks.

Break to wake up from Sleep mode

Could you provide an example to wake the module up from sleep mode with a break?

I just found some explanation in page 11 of following datasheet, but still unclear for me.

To wake the AX−Sigfox up from Sleep mode toggle the serial UARTRX pin, e.g. by sending a break (break is an RS232 framing violation, i.e. at least 10 bit durations low).

https://www.onsemi.com/pub/Collateral/AX-SIGFOX-D.PDF

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.