Home

Awesome

Calliope mini BC95 NB-IoT module

This is a package for controlling an NB-IoT module to send messages from the Calliope mini. It can be used by the PXT Calliope mini editor. Should also work with PXT for Micro:bit.

More information on the module can be found on the Quectel website. It is used in conjunction with an evaluation kit.

Wiring the module

Calliope mini - BC95 wiring

Testing

On the USB console window you will see this:

TEST START
!!!!  BC95/AT TEST
TEST: modem working: OK
TEST: enable all functionality: OK
TEST: check IMSI: OK
TEST: connect to network: OK
TEST: check signal quality: OK
TEST: check network stats: OK
TEST: check PDP context: OK
TEST: check address: OK
TEST: check band: OK
TEST: ping external server: OK
TEST: expect ping reply: OK
!!!!  BC95 TEST
TEST: sending number (temp): OK
TEST: sending number (light): OK
TEST: sending string: OK
TEST FINISHED OK

You can follow the AT flow on the USB serial console by enabling debug in tests.ts

The server should show something like this:

connect to [46.23.86.61] from tmo-121-137.customers.d1-online.com [80.187.121.137] 25519
{"temp":30}{"light":255}{"test":"value 30"}

Example

Blocks

Example Code

Javascript

// run on your server server: nc -vv -ul -p 9090
input.onGesture(Gesture.Shake, () => {
    bc95.send(
        "{\"accel\":" + input.acceleration(Dimension.Strength) + "}"
    )
})
input.onButtonPressed(Button.A, () => {
    bc95.send(
        "{\"temp\":" + input.temperature() + "}"
    )
})
modem.enableDebug(true)
bc95.init(
    SerialPin.C17,
    SerialPin.C16,
    BaudRate.BaudRate9600
)
bc95.attach(
    0
)
bc95.setServer("46.23.86.61", 9090)
bc95.send(
    "{\"temp\":" + input.temperature() + "}"
)

The first temp is right from the START, the second, pressing Button A and the accel is when shaked.

$ listening on [any] 5883 ...
connect to [46.23.86.61] from tmo-121-137.customers.d1-online.com [80.187.121.137] 24189
{"temp":30}{"temp":30}{"accel":2057}

TODO

Meta

Depends on pxt-calliope-modem.

Author: Matthias L. Jugel (@thinkberg)

License

MIT