Layout help with ethernet featherwing

So I got me a particle ethernet featherwing. I have plugged in an argon in the middle slot and an OLED featherwing in the third slot.

I am totally confused how to hook up my sensors from here! I am totally new to this. I have 3 sensors I’d like to connect to this setup :

I’d appreciate some help with how to lay this all out when using the particle argon with the ethernet featherwing as stated above. A noob confusion.

The first two sensors want to be connected to SCL/SDA (aka I2C interface) while the third one can either be connected to I2C or RX/TX (UART).

To connect them you’d just use the proto area on the EtherWing.

So remove the argon or LCD and connect the sensors to the etherwing before connecting the argon on top ? Apologies I am new to this.

You should have some experience with soldering to connect your sensors properly, but yes, it’s best to remove all removable components from the EtherWing when you want to solder in the wires you’ll be hooking up your sensor with.

Hello @ScruffR

For the third one ( the dust sensor ), I connected it to serial 1 (rx/tx) on the ethernet featherwing. In my ino file, I was supposed to set it to something like this:

#define SP30_COMMS SERIALPORT1
#define TX_PIN 8
#define RX_PIN 8

I think the pin numbers in my case will be different from 8? I am not sure what it should be. Others who have used this library set it to 8 ( when connected to serial 1 on their photons) but in my case, I am using an argon/xenon on an ethernet featherwing. I suspect thats why its not working.

You can use RX and TX as pin names, no need to define your own.
Furthermore SERIALPORT1 is not a known macro AFAICT - you should rather use Serial1.

On Photons there is no pin 8.

@ScruffR This is a bit over my head. What does this mean?

Also what does this become then? It seems I need to define the pins the sps30 is connected to.

#define TX_PIN 8
#define RX_PIN 8

Which library are you using?

I have been referencing this: Dust Sensor - PMS 5003/6003/7003 - #110 by RWB - where they seem to be using the photon?

So i did this using the library:

#define SP30_COMMS SERIAL1

And it failed to compile.

@vacquah, the name is case sensitive. You need to use Serial1 not SERIAL1.

I’m currently looking at the library and it’s quite convoluted as it is meant to support multiple platforms. Consequently there are lots of compiler conditionals that make following the code somewhat more complicated.
I now see that SERIALPORT1 is part of an enum in that library which is in turn used to select Serial1 in code (not the most elegant way of doing it tho’ IMO).

That TX_PIN = RX_PIN = 8 also appears to be a trick to enable some special treatment for Particle devices (again, there would have been more elegant, less confusing ways).

However, since @RWB appears to have such a sensor at hand (which I don’t) he might be able to assist - but as I’ve just seen, you have already contacted him in this other thread a few days ago.
Give him some time to respond. But looking at the code you provided, I’d suggest you first create a dedicated test project that focuses on that one sensor alone without all the other bells and whistles.
This way you can focus on one thing and people who may want to help don’t have to burden themselves with reading tons of unrelated code burrying the actual issue at hand.

1 Like

It doesnt compile when I use Serial1. But works ok with SERIALPORT1. Maybe its defined in the library.

@ScruffR I used that library because it seemed to be the one most people used in the link i provided above, after trying a couple of others for the sps30.

I just created a test project today - stripping out everything except the code for the sps30. Still didnt work, Thats when I started looking at the way things are defined specifically for my use case. I am not sure @RWB is using the ethernet featherwing so his pin definitions might be different.

I am using this code now,

With the only changes made being

#define TX_PIN 8
#define RX_PIN 8

and commenting out the following in this sps30.h file.

#define INCLUDE_I2C   1 
#define INCLUDE_SOFTWARE_SERIAL 1 

Maybe you can post/link that project over at the other thread too - looking at the code you originally linked there I would have avoided going into that myself too, it's just TL;DR.


About this

As I said, that TX_PIN = RX_PIN = 8 has some special meaning in the library.
Once you change that, that special treatment will not happen.

I was not using the ethernet feather wing FYI.

So looks like this library wont work for me because I am using the ethernet featherwing? Doesnt look like anyone has tried that combo.

@RWB Have you tried any other library for the sps30 besides this? It looks like this is the only library everyone is using with the sps30?

I still can’t get this to work. I sent an email to the developer of the library and he said setting the TX and RX pins to 8 simply forces the library to default to the serial1 pins. In my case, thats 9 and 10 on the argon on the ethernet featherwing. That’s where I have the sensor connected too. I am using the exact basic code I posted above - nothing else in there.

in the console, I see this:

And if I add SYSTEM_THREAD(ENABLED); I see this:

In the second case, pressing enter has no effect and the code loops.

I’d appreciate some help since I am really out of my depth here. Many thanks.

particle serial monitor will not send anything to the device - it’s only a monitor
So hitting ENTER won’t do anyhting.
You need to use a different serial terminal program.