paulvha / sps30

Sensirion SPS30 driver for ESP32, SODAQ, MEGA2560, UNO,UNO-R4 ESP8266, Particle-photon on UART OR I2C coummunication
GNU General Public License v3.0
66 stars 27 forks source link

SPS30 - Not A Teamplayer - Problems with other devices on I2C #5

Closed detamend closed 5 years ago

detamend commented 5 years ago

First the important stuff: Paul: I love your library! SENSIRION should hire you for the job you did here.

SYSTEM: ESP8266 / WeMOS D1 Board Arduino IDE 1.8.9 esp8266 Library V2.5.2

I2C Devices SENSIRION SPS30 BME680 D1 OLED-Display Shield

I'm developing a Sensor-Reader/Data-Logger device, set up the SPS30 pretty much the way you did in the examples.

I read the sensor every two seconds, together with the BME680 and update the Display (via the u2g8 Library). And I get garbage like that:

19-06-12_garbage.txt (Tab separated text file)

Interestingly, if I disable the routines, that write the Display - the SPS30 works fine:

19-06-12_ok.txt

I tried to leave the SPS30 "time to breathe" by tick-tocking every second between reading the SPS30 on even seconds and writing the display on the odd ones - no success.

Tried the combination SPS30/BME680/Display unter the ESP8266-Lib 2.4.2 and it worked. Sadly, we can't go back, b'c some upcomming devices depend on the 2.5.2 Library - welcome to dependency hell.

One more thing: currently the devices are read/written to in that oder:

tick:

tock:

If I change the order, so the BME680 gets read before the SPS30, it screws up the measurement again.

I know: your library comes without warranty or help - if you got any idea what's going on there, it would be greatly appreciated.

paulvha commented 5 years ago

HI Detlef

Thanks for reaching out. Currently working full time on other project but some thoughts.

Hard to understand what is really happening. Weird that it works with 2.4.2 and not with 2.5.2… I had created an example with a BME280 only/ The BME680 did not add enough change for me.

I also see GPS location in the documents. How was that added ? Could there be any issue with clock stretch ? Normally the BME680 does not need that, but still. Can you share the .ino you use? Maybe I can spot something in there? Do you have pull resistors on I2C ? The SPS30 is very sensitive that ?

Greetings from the Netherlands,

Kind regards

Paul

Van: Detlef Amend notifications@github.com Verzonden: woensdag 12 juni 2019 21:19 Aan: paulvha/sps30 sps30@noreply.github.com CC: Subscribed subscribed@noreply.github.com Onderwerp: [paulvha/sps30] SPS30 - Not A Teamplayer - Problems with other devices on I2C (#5)

First the important stuff: Paul: I love your library! SENSIRION should hire you for the job you did here.

SYSTEM: ESP8266 / WeMOS D1 Board Arduino IDE 1.8.9 esp8266 Library V2.5.2

I2C Devices SENSIRION SPS30 BME680 D1 OLED-Display Shield

I'm developing a Sensor-Reader/Data-Logger device, set up the SPS30 pretty much the way you did in the examples.

I read the sensor every two seconds, together with the BME680 and update the Display (via the u2g8 Library). And I get garbage like that:

19-06-12_garbage.txthttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpaulvha%2Fsps30%2Ffiles%2F3282789%2F19-06-12_garbage.txt&data=02%7C01%7C%7Ce4ab94b83c0d4035983808d6ef6ace9a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636959639343464210&sdata=%2BdLEzsni5FS96FiT%2F2tUpRivvEcl%2FOq6MX1lDlySh2I%3D&reserved=0 (Tab separated text file)

Interestingly, if I disable the routines, that write the Display - the SPS30 works fine:

19-06-12_ok.txthttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpaulvha%2Fsps30%2Ffiles%2F3282812%2F19-06-12_ok.txt&data=02%7C01%7C%7Ce4ab94b83c0d4035983808d6ef6ace9a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636959639343474213&sdata=bsauE7Zj%2BQAXqVgirOtahMpUSoU%2BPS4uQRG6rrEiglY%3D&reserved=0

I tried to leave the SPS30 "time to breathe" by tick-tocking every second between reading the SPS30 on even seconds and writing the display on the odd ones - no success.

Tried the combination SPS30/BME680/Display unter the ESP8266-Lib 2.4.2 and it worked. Sadly, we can't go back, b'c some upcomming devices depend on the 2.5.2 Library - welcome to dependency hell.

One more thing: currently the devices are read/written to in that oder:

tick:

tock:

If I change the order, so the BME680 gets read before the SPS30, it screws up the measurement again.

I know: your library comes without warranty or help - if you got any idea what's going on there, it would be greatly appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpaulvha%2Fsps30%2Fissues%2F5%3Femail_source%3Dnotifications%26email_token%3DAD2GBPDELEMRSKIS2GFI333P2FDZZA5CNFSM4HXPR3LKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZESFGA&data=02%7C01%7C%7Ce4ab94b83c0d4035983808d6ef6ace9a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636959639343484237&sdata=mZsrzOfW4Sx7fCYRLdf9angV10Q3rz88YMaJ8UHg2G0%3D&reserved=0, or mute the threadhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD2GBPED7XJSXAYEPHVM4C3P2FDZZANCNFSM4HXPR3LA&data=02%7C01%7C%7Ce4ab94b83c0d4035983808d6ef6ace9a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636959639343494271&sdata=2ZaSJvniAIko5JhYKowhJXQT1RgHRUYqCyHbnEDzP%2BE%3D&reserved=0.

detamend commented 5 years ago

Paul, I'm really grateful for your input!

BME680 <> BME280 - we wanted to have the option to use this one; and yeah, it's pretty similar. In the current devBranch a 280 would do fine.

GPS - a somple GPS Module, connected via Serial and processed by tinyGPS++

Clock Strech - I remember that I read about it somewhere, but can't tell right now what that does.

Pull Ups - check, 10k x 2

I cobbled together the routines that matter in this ZIP:

SPS30_DataLog.zip

It's a multi-Tabbed INO, so I put all the functions into different files to keep my head at least a bit over water.

May start with 03_LOOP.ino - that's the sequence, that loops through the different modules. From there you find the routines in the so named *.inos.

I left Debug, WLAN auf a bunch of stuff out - so you won't have to fight through these ;)

Thanks in advance!!!

zz-zsys commented 5 years ago

Hi @detamend,

This problem has occured to me before. It tooks me a while to find out why this problem occured. The reason why this happens is because of the U8G2 library that you used. The default configuration for the i2c clock for SSD1306 on that library is 400kHz. Meanwhile SPS30 only supports max. 100 kHz. BME680 or BME280 still function because they do still support up to 400 kHz. As a solutions, set your display i2c clock to 100 kHz using u8g2.setBusClock function before u8g2.begin function. Hope this will solved your problem.

Best regards from Berlin, ZZ

detamend commented 5 years ago

zz-zsys - you're my hero! I owe you guys a beer or two!

Thanks a lot!!

paulvha commented 5 years ago

Great Teamwork !!!. The real power of open source and sharing 😊

Regards, Paul

Verzonden vanuit Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 voor Windows 10


Van: Detlef Amend notifications@github.com Verzonden: Wednesday, June 12, 2019 11:50:34 PM Aan: paulvha/sps30 CC: paulvha; Comment Onderwerp: Re: [paulvha/sps30] SPS30 - Not A Teamplayer - Problems with other devices on I2C (#5)

zz-zsys - you're my hero! I owe you guys a beer or two!

Thanks a lot!!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpaulvha%2Fsps30%2Fissues%2F5%3Femail_source%3Dnotifications%26email_token%3DAD2GBPGPSKZHQ5XHK2UEGSTP2FVSVA5CNFSM4HXPR3LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXR4YFQ%23issuecomment-501468182&data=02%7C01%7C%7Cbef3f0824b264ae78f9a08d6ef80000d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636959730369457879&sdata=wfsQGBOh8ZRUQj3eoceYXPojEc4ftxsJiNVJldT5PVs%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD2GBPC4EZCTQLP6C42CVCDP2FVSVANCNFSM4HXPR3LA&data=02%7C01%7C%7Cbef3f0824b264ae78f9a08d6ef80000d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636959730369477895&sdata=bHPdtZTuA2OLGU0uIJY%2BzMD2ok%2BwDmoFLg51gAQwyFg%3D&reserved=0.

paulvha commented 5 years ago

issue closed

Mohit2183 commented 4 years ago

we were testing your sps30 by connecting with docklight. we have used usb to serial converter to command the sps30. pin 1 was connected to poer supply +5vdc , pin 5 was connected to 0vdc. pin4 was left open for UART, pin 2 was connected to Tx of master (PC), pin 3 was connected to Rx of master (pc). From docklight v2.3 we had set the com port , 115200, 8N1 communication settings. we have placed command in format of Hex codes i.e. start command Tx: 7E 00 00 01 02 F9 7E , Rx REPLY: 7E 00 00 01 02 F9 7E , Tx: 7E 00 00 00 FF 7E, Rx REPLY: x: 7E 00 00 00 FF 7E , Tx: 7E 00 03 00 FC 7E , Rx REPLY: 7E 00 03 00 FC 7E , Tx: 7E 00 D3 00 2C 7E, Rx REPLY: 7E 00 D3 00 2C 7E . OVER ALL FAN IS ALSO NOT ROTATING PHYSICALLY.. could you pls guide us why sps30 is not giving response to our commands on dock light.