paulvha / scd30

arduino esp8266 ESP8266 SCD30 SCD-30 ESP32 UNOR4
Other
41 stars 11 forks source link

Second I2C Bus #4

Closed leic3d closed 3 years ago

leic3d commented 3 years ago

Hi,

I'm trying to get a set of 2 SCD30 working with an ESP32. Since I did not find a way to change the I2C adress of the SCD30, I now try to use the second I2C bus of the ESP32 to get both working with the same adress. However, it seems that your twowire class in softwire does not include the functionality to use a second bus. I tried to compare your softwire.cpp and twi.cpp to the corresponding files of the "normal" wire.cpp (and others used) but i cannot find a solution to add the functionality to use the second bus. Can you help with that?

Thank you very much, Michael

paulvha commented 3 years ago

HI Micheal,

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

Van: leic3dmailto:notifications@github.com Verzonden: zondag 12 juli 2020 23:23 Aan: paulvha/scd30mailto:scd30@noreply.github.com CC: Subscribedmailto:subscribed@noreply.github.com Onderwerp: [paulvha/scd30] Second I2C Bus (#4)

Hi,

I'm trying to get a set of 2 SCD30 working with an ESP32. Since I did not find a way to change the I2C adress of the SCD30, I now try to use the second I2C bus of the ESP32 to get both working with the same adress. However, it seems that your twowire class in softwire does not include the functionality to use a second bus. I tried to compare your softwire.cpp and twi.cpp to the corresponding files of the "normal" wire.cpp (and others used) but i cannot find a solution to add the functionality to use the second bus. Can you help with that?

Thank you very much, Michael

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpaulvha%2Fscd30%2Fissues%2F4&data=02%7C01%7C%7C343099c9dcd9491b536f08d826a9e1dc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637301858358914684&sdata=X2WG%2FQvXINNQSsHB1SxAXIhndBoCGYFm1Wpht%2FXcL7E%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD2GBPDYGSWYLKH45ZKQM63R3ISWVANCNFSM4OX7OWXA&data=02%7C01%7C%7C343099c9dcd9491b536f08d826a9e1dc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637301858358914684&sdata=JJIEu8vc2jru%2FiNJMc9utBWNQW9ddcjk8mseTnMvHzU%3D&reserved=0.

paulvha commented 3 years ago

HI

I am going to have a look at it today. I will let you know.

Regards, Paul

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

Van: leic3dmailto:notifications@github.com Verzonden: zondag 12 juli 2020 23:23 Aan: paulvha/scd30mailto:scd30@noreply.github.com CC: Subscribedmailto:subscribed@noreply.github.com Onderwerp: [paulvha/scd30] Second I2C Bus (#4)

Hi,

I'm trying to get a set of 2 SCD30 working with an ESP32. Since I did not find a way to change the I2C adress of the SCD30, I now try to use the second I2C bus of the ESP32 to get both working with the same adress. However, it seems that your twowire class in softwire does not include the functionality to use a second bus. I tried to compare your softwire.cpp and twi.cpp to the corresponding files of the "normal" wire.cpp (and others used) but i cannot find a solution to add the functionality to use the second bus. Can you help with that?

Thank you very much, Michael

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpaulvha%2Fscd30%2Fissues%2F4&data=02%7C01%7C%7C343099c9dcd9491b536f08d826a9e1dc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637301858358914684&sdata=X2WG%2FQvXINNQSsHB1SxAXIhndBoCGYFm1Wpht%2FXcL7E%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD2GBPDYGSWYLKH45ZKQM63R3ISWVANCNFSM4OX7OWXA&data=02%7C01%7C%7C343099c9dcd9491b536f08d826a9e1dc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637301858358914684&sdata=JJIEu8vc2jru%2FiNJMc9utBWNQW9ddcjk8mseTnMvHzU%3D&reserved=0.

paulvha commented 3 years ago

I had a look and checked the latest datasheet SCD30 (march 2020). The only added option is the ability to read the firmware level. I consider adding that later. Softwire is a port of the I2C from the ESP8266 and in it's current form it only supports one I2C channel. You could try to use the standard Wire.h and set for very low speed to read the SCD30, e.g. 35Khz instead of 100Khz. You might be lucky with the clock-stretching not happening too long. For this you need to change in paulvha_scd30.h around line 64.