Single Channel Gateway part 1

reading and understanding the headline is always a good idea.
and I did not recognize that the node changes the channel each time it sends a packet.
thanks @Thomas , @Batilan for their explanation

1 Like

Should we give the Testing gateway a specific mac-adress?

Maybe something start / end -> MAC: “1CHA” ??

@popcorn Please don’t make up your own prefixes. The single channel gateway now uses MAC-48 to EUI-64 conversion for the gateway ID.

Gateways send a platform field in their stat updates, that can be used to identify the type. We should make that available in the API for this purpose.

Thanks. I will wait a bit for that :D.

Hi. Can I adjust it to 915 MHz just editing line 74

uint32_t freq = 868100000; // in Mhz! (868.1)

uint32_t freq = 915000000; // in Mhz! (915)


Hi Vidal,

Yes, that should work. You probably want to set the single channel center to 915.1 Mhz then (it is 125 kHz wide).


Another HopeRF SX1276 based packet forwarder is working fine.

One remark regarding wiring. WiringPi takes care of the SPI chip select itsself,
so there is no need to manually handle the chip select, if you connect nss to CE0
or CE1 (corresponds to CHANNEL=0 or CHANNEL=1 in WiringPi).

Found it out by accident, because initially I had connected reset to CE0 (bad idea).

Thanks for the remark, I had noted it too, it is a left-over from experimentation to get this to work. I’ll change it in wiring instructions, with a note, but leave the manual select in the code for a while to not break on existing hardware.


Nice project but something wrong with my configuration:

I build the Single Channel Gateway with a RFM95W and a Raspberry Pi B+. The code is from and running on Raspbian Wheezy.

When I start the package forwarder I get the error:

“Unrecognized Transceiver”

I’ve searched for that error and found in the main.cpp:

void SetupLoRa()

digitalWrite(RST, HIGH);
digitalWrite(RST, LOW);

byte version = readRegister(REG_VERSION);

if (version == 0x22) {
    // sx1272
    printf("SX1272 detected, starting.\n");
    sx1272 = true;
} else {
    // sx1276?
    digitalWrite(RST, LOW);
    digitalWrite(RST, HIGH);
    version = readRegister(REG_VERSION);
    if (version == 0x12) {
        // sx1276
        printf("SX1276 detected, starting.\n");
        sx1272 = false;
    } else {
        printf("Unrecognized transceiver.\n");
        //printf("Version: 0x%x\n",version);


I thought that HopeRFM95W is compatible with the SX1276.
Any ideas what coud be wrong here?

Hi Marco,

Your setup looks fine, but most likely the wiring is not correct. It simply doesn’t see your RFM95W.

Hi Thomas,

Thank you for the reply,
I’m just going back upstairs to my workbench for checking the wires :joy:

Hi Thomas,

Yes, MISO was broken (the wire ;-).,and my Single Channel Gateway is working now!

OK, I have to admit, there are easier ways to attach a HopeRF module to your RPi but, I got an idea and then it is a nice challenge to design, print and assemble these parts.

whenim641 uploaded this image to

Printed parts

whenim641 uploaded this image to
whenim641 uploaded this image to
whenim641 uploaded this image to
whenim641 uploaded this image to

…and it looks like I’m recieving packets?? there a node in the area?

rxpk update: {“rxpk”:[{“tmst”:3628397007,“chan”:0,“rfch”:0,“freq”:868.100000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW 125”,“codr”:“4/5”,“lsnr”:10,“rssi”:-68,“size”:63,“data”:“QAE7AQKAJwAFAasyOToyYGXKRgV5eRRCqcwTa2KGQLODV9R1sCFaOnwJ Jg9kAYMboXDmFT9mPkUQkaHQvmTV”}]}


Hi Marco,

It certainly looks like there is a node in your area from your logging (line starting with “rxpk update:” indicate received packets.

Remember that your gateway only listens to one “channel”, while nodes switch channels constantly. This means you will see something like one in ten packets with the single channel gateway.

Nice setup, BTW. Mine looks like this:


1 Like

Yeah, I’m curious who is sending. Nice setup…KIS (keep it simple :wink:

Yes, please keep it available as modifying the hardware is a pain with wires terminating underneath the RFM adapter board.

I got a working gateway and a working node. I do receive packets from a unknown node but:

Why is my gateway not visible with the API or Mqtt on thethingsnetwork?
What can be the reason that I can’t see any packets from my working node?

Any help will be appreciated

Network seems to be down since yesterday evening

Continuing the discussion from Migrated demonstration back-end: restart packet forwarders:

So the single channel gateway needs a code change:

Change #define SERVER1 "" to
#define SERVER1 "" 

The code will probably be adjusted to use name resolving.

Note: I adjusted this post to contain the “final” IP address so people don’t get confused by a post containing an adjustment that was only valid for an hour or so. A version of the single channel gateway with name resolving is on the way.

1 Like

Yes I changed the IP address and compiled again…but at the moment it doesn’t work.
By the way I can’t ping that ip address

Shortly after I posted my message the IP address changed again :smirk:, it is now an “elastic IP” which can be reused for future instances too. So the line should become:
#define SERVER1 ""

Note that at the moment the API is not able to connect to the database:
> HTTP 200 OK
> Content-Type: application/json
> Vary: Accept
> {
> “error”: “Cannot connect to database!”
> }