-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QWIIC BLOWER FAN EXAMPLE FAILS TO RUN #3
Comments
That is usually caused by the incorrect I2C address being used. By default, the Qwiic Fan Arduino Library uses the default I2C address of 0x36. Your Sparkfun Qwicc Blower Fan has probably had its I2C address changed. You probably need to run an I2C scan sketch to determine what the I2C address your Sparkfun Qwicc Blower Fan is using. Once you determine its I2C address, you can change the "blower.begin()" line in the Example1_SetFanSpeed to "blower.begin(Wire, <your_I2C_address>)" and it should then work. |
Hi Dan
Here is the code I am using based on example1 I added a I2C scan function
but it says no devices found, When I try and pass a value of 36 I get a
compiler error, I am using a blackboard and arduino 1.8.10
no matching function for call to 'PCFan::begin(int)'
thanks
/*
This is a example written for the SparkFun Qwiic Blower Fan
SparkFun sells these at its website: www.sparkfun.com
Do you like this library? Help support SparkFun. Buy a board!
https://www.sparkfun.com/products/18561
Written by Nick Poole @ SparkFun Electronics, October 258h, 2021
This example code demonstrates how to set and get the fan speed
by randomly generating fan speeds between 0 and 8000 RPM
and sending them to the board. It then reads the fan tachometer for
comparison.
https://github.com/sparkfun/SparkFun_Qwiic_Fan_Arduino_Library
Development environment specifics:
Arduino IDE 1.8.7
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <SparkFun_Qwiic_Fan_Arduino_Library.h>
#include <Wire.h>
// Initialize the board
PCFan Blower;
void setup()
{
Wire.begin();
Serial.begin(115200); // Start serial communication at 115200 baud
scanI2C();
Serial.println("Qwiic Blower Fan Example 1: Setting the Fan Speed");
if (Blower.begin(36) == true) // Function to check if the board will ACK
{
Serial.println("Begin");
}
else
{
Serial.println("Device failed to setup - stopping");
while (1); // Just sit and do nothing
}
Blower.disableFan();
}
void loop() {
// Pick a random speed between 0 and 8000 RPM (In 1000 RPM increments)
int randSpeed = random(0,8) * 1000;
// Print the number to the terminal
Serial.print("Setting Fan Speed to ");
Serial.print(randSpeed);
Serial.println(" RPM");
// Set the fan speed
Blower.setFanSpeed(randSpeed);
// For the next 3 seconds, once per second, ask the board for a
tachometer reading
// and report it to the terminal
for(byte i = 0; i < 3; i++){
delay(1000);
Serial.print("Tachometer Reads ");
Serial.print(Blower.getFanSpeed());
Serial.println(" RPM");
}
// Print an empty line to make the terminal more readable
Serial.println();
delay(1000);
}
void scanI2C()
{
byte error, address;
int nDevices;
Serial.println("Scanning I2C devices...");
nDevices = 0;
for (address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print(F("I2C device found at address 0x"));
Serial.println(address, HEX);
nDevices++;
}
else if (error == 4)
{
Serial.print("Unknown error at address 0x");
if (address < 16)
Serial.print("0");
Serial.println(address, HEX);
}
}
// clear row 3 that was display i2c devices found
if (nDevices == 0)
{
Serial.println("No I2C devices found\n");
}
else
{
Serial.print(nDevices);Serial.println(" I2C devices found");
}
delay(1000); // wait 5 seconds for next scan
}
…On Wed, Dec 29, 2021 at 9:38 AM Dan ***@***.***> wrote:
That is usually caused by the incorrect I2C address being used. By
default, the *Qwiic Fan Arduino Library* uses the default I2C address of
*0x36*. Your Sparkfun Qwicc Blower Fan has probably had its I2C address
changed. You probably need to run an I2C scan sketch to determine what the
I2C address your Sparkfun Qwicc Blower Fan is using.
Once you determine its I2C address, you can change the "*blower.begin()*"
line in the Example1_SetFanSpeed to "*blower.begin(Wire,*
<your_I2C_address>*)*" and it should then work.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37I5PYY5AXLZPGKPPODUTMMPHANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
fyi I added a second I2C device (TMP117) and it discovered that but not the
fan so the scan routine seems ok
Scanning I2C devices...
I2C device found at address 0x48
1 I2C devices found
…On Wed, Dec 29, 2021 at 9:38 AM Dan ***@***.***> wrote:
That is usually caused by the incorrect I2C address being used. By
default, the *Qwiic Fan Arduino Library* uses the default I2C address of
*0x36*. Your Sparkfun Qwicc Blower Fan has probably had its I2C address
changed. You probably need to run an I2C scan sketch to determine what the
I2C address your Sparkfun Qwicc Blower Fan is using.
Once you determine its I2C address, you can change the "*blower.begin()*"
line in the Example1_SetFanSpeed to "*blower.begin(Wire,*
<your_I2C_address>*)*" and it should then work.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37I5PYY5AXLZPGKPPODUTMMPHANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi @JimKruk , Which processor board are you using? If you're using an Artemis-based board, this might be a clock-stretching issue. Have you tried ignoring the result of Best wishes, |
Jim, If your Qwiic Blower Fan is getting power and your connections are OK, then you might have a defective Qwiic Blower Fan. If that's the case, I'm afraid I can't help you. (If you are familiar with electronics troubleshooting, you could also check that pin 2 of the 6-pin AVR ISP Connector holes on the back side of the board measures about 5V. If not, there could be a problem with the onboard U3 DC-DC Converter - see schematic. Everything on the Qwiic Blower Fan runs on 5V) Also, two things about the use of the alternate "Blower.begin()". First, you are missing the "Wire" parameter and second, the address you used was decimal and you probably want the hex number with a leading '0x' (that's what the scan tool provides). That's why you had the compile error. The "begin()" optionally takes two parameters: TwoWire &wirePort and uint8_t deviceAddress. |
Hi Paul
I am using the sparkfun blackboard with a qwiic connection I am not home
right now but will try commenting out the loop and let you know. Kinda
doubt it will work since the i2c scanner does not see anything.
Thanks
…On Wed, Dec 29, 2021 at 11:34 AM Paul ***@***.***> wrote:
Hi @JimKruk <https://github.com/JimKruk> ,
Which processor board are you using? If you're using an Artemis-based
board, this might be a clock-stretching issue.
Have you tried ignoring the result of Blower.begin()? What happens if you
comment the while(1); // Just sit and do nothing? Does the rest of the
code run normally?
Best wishes,
Paul
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37P7GYQFHMHRAY7E7Q3UTM2DFANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi Dan
Do you have an example of what I would code on the begin() line ? When I
get home home I will try and get some voltage measurements. I am using a
blackboard and a qwiic cable so no wiring per say.
Thanks
…On Wed, Dec 29, 2021 at 11:38 AM Dan ***@***.***> wrote:
Jim,
The fact you can scan and find another I2C device says you might have a
problem with your Qwiic Blower Fan. Are you sure you are providing about
3.3V to it? You can measure it on the labeled point near the edge on the
top or bottom of the board. Also, make sure your SDA and SCL (and GND)
connections are all OK in the Qwiic wiring cable if that's what you're
using.
If your Qwiic Blower Fan is getting power and your connections are OK,
then you might have a defective Qwiic Blower Fan. If that's the case, I'm
afraid I can't help you. (If you are familiar with electronics
troubleshooting, you could also check that pin 2 of the 6-pin AVR ISP
Connector holes on the back side of the board measures about 5V. If not,
there could be a problem with the onboard U3 DC-DC Converter - see
schematic. Everything on the Qwiic Blower Fan runs on 5V)
Also, two things about the use of the alternate "*button.begin()*".
First, you are missing the "*Wire*" parameter and second, the address you
used was decimal and you probably want the hex number with a leading '0x'
(that's what the scan tool provides). That's why you had the compile error.
The "*begin()*" optionally takes two parameters: *TwoWire &wirePort* and *uint8_t
deviceAddress*.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37OWL6HOBX6FQOUBI7LUTM2QJANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Jim, then use: in place of the default: Note: The Blower.begin() basically does a scan of one particular I2C address looking for a device at that address to acknowledge the query of that address. So, if a I2C scan sketch can find the Fan's I2C address, a Blower.begin() that implicitly (at 0x36) or explicitly at a specified address should also be successful. As far as I can see from the Sparkfun Blackboard schematics, it is essentially the standard Arduino UNO compatible with Qwiic connections and being able to optionally run the processor at 3.3V instead of 5V. As to Paul's comment about clock-stretching, this should not be an issue as its ATmega328 TWI supports clock stretching. |
Hi Dan The code continues but does not change the fane speed. Scanning I2C devices... Setting Fan Speed to 1000 RPM I actually bought two of these fans and both have the same problem. The fact the i2c scanner can find the tmp117 sensor makes me believe there is something wrong with the boards. Are you a SF employee ? could you pull one from stock and see if it has the same issue ? |
Jim, I don't actually have one of their Fan boards but have compiled its firmware to run on an Arduino Nano to simulate some of its operation to better understand how it works. In my simulated testing, I've turned off the PI loop operation and have just used its proportional throttle operation. Since you can't find the Fan's I2C address, you'll never be able to control or communicate with the Fan. Commenting out the while(1) is unlikely to change anything - it just allows blindly sending commands to the I2C bus with nothing responding to them. If you've confirmed all of the Qwicc connections, it sounds like your units are defective! |
Hi Dan |
Hi everyone, Sorry for the delay. I'm the engineer who designed the product and I'm on holiday vacation. It sounds possible that you got a defective board, since it isn't responding on any I2C address. Have you tried both Qwiic connectors on the fan board? If you have experience using the "upload using programmer" function in Arduino (and an ISP or arduino board that you can load ArduinoISP on, then you can attempt to reprogram the firmware. Otherwise, if your board has never worked, we can replace it. Also, @dlkeng, thanks for being on top of this! It sounds like you did everything you could considering you don't have the unit in front of you. |
Hi Nick
Thanks for getting back to me, I did try both qwiic connectors. I don’t
have any experience with reprogramming the firmware, probably out of my
skill set :( I don’t want to burden you on your vacation, this can wait
until next week.
Any chance you could pull one from stock next week and see it it also fails
or should I go ahead and mail them back ? Could someone test the new ones
before mailing them back ?
Thanks again for the quick reply!
Jim
…On Wed, Dec 29, 2021 at 7:32 PM Nick Poole ***@***.***> wrote:
Hi everyone, Sorry for the delay. I'm the engineer who designed the
product and I'm on holiday vacation.
It is, of course, our (SparkX) fault that you were directed away from Tech
Support. They've been instructed to direct tech support requests to us so
we don't burden them with our "experimental" products.
It sounds possible that you got a defective board, since it isn't
responding on any I2C address. Have you tried both Qwiic connectors on the
fan board?
If you have experience using the "upload using programmer" function in
Arduino (and an ISP or arduino board that you can load ArduinoISP on, then
you can attempt to reprogram the firmware.
Otherwise, if your board has never worked, we can replace it.
Also, @dlkeng <https://github.com/dlkeng>, thanks for being on top of
this! It sounds like you did everything you could considering you don't
have the unit in front of you.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37PCPU6EHLD4UFV7LUDUTOSDDANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
No worries! Yes, I'll email someone at the office and see if we can do that. I'll let you know when I hear back |
Great, thanks Nick !
…On Wed, Dec 29, 2021 at 8:21 PM Nick Poole ***@***.***> wrote:
No worries!
Yes, I'll email someone at the office and see if we can do that. I'll let
you know when I hear back
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37PTURFVLY2DTAMQ7WLUTOXYBANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hey @JimKruk, just want to let you know that we're working on testing a unit to ship you as a replacement, no need to send us back the busted one. I'll make sure someone emails you from SparkFun when the replacement ships. Sorry again for the delay. |
Awesome, thanks for the update Nick. Btw Russell Turner from sf emailed me
about this also, not sure he is coordinating with you on this.
Curious, is this a firmware issue or just bad luck on the two fans I
received?
Thanks
…On Wed, Jan 5, 2022 at 1:24 AM Nick Poole ***@***.***> wrote:
Hey @JimKruk <https://github.com/JimKruk>, just want to let you know that
we're working on testing a unit to ship you as a replacement, no need to
send us back the busted one. I'll make sure someone emails you from
SparkFun when the replacement ships. Sorry again for the delay.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37N244KNWWHMAGPE3KLUUPP3JANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I just messaged him to make sure we're not duplicating our efforts It seems to me that there was no firmware on the unit that you received and right now we're trying to determine whether a few units were faulty or if an entire batch made it into stock without getting programmed. |
Ok, thanks.
…On Wed, Jan 5, 2022 at 2:38 PM Nick Poole ***@***.***> wrote:
I just messaged him to make sure we're not duplicating our efforts
It seems to me that there was no firmware on the unit that you received
and right now we're trying to determine whether a few units were faulty or
if an entire batch made it into stock without getting programmed.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3Q37JUTM6O4UYVWDUOHDDUUSM27ANCNFSM5K265ULQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi Nick |
Hi Nick |
Hi Nick |
Hi Jim! You could program the firmware on these units using a SparkFun Redboard/Arduino Uno/etc. as a programmer, if you want to attempt it, I'll give you instructions here. I've just tried it on my end to make sure it works. Step 1) Program Redboard with the ArduinoISP sketch Open this sketch and Upload it Step 2) Attach the RedBoard to your Qwiic Fan Blower Here is the pinout of the Qwiic Blower programming header. Pin 1 is the one marked with a line on the silkscreen:
Step 3) Install the board package Step 4) Open the firmware in Arduino Step 5) Set the board options Step 6) Select "Arduino as ISP" as your programmer Step 7) Run the "Burn Bootloader" option in the "Tools" menu Step 8) Program the firmware Once this is finished, the board should be programmed. If you decide to attempt this, please let me know how it goes. |
https://www.sparkfun.com/products/18561 Qwiic Blower Fan
downloaded the code from here: https://github.com/sparkfun/SparkFun_Qwiic_Fan_Arduino_Library
Example1_SetFanSpeed using a blackboard. when I plug in the USB the fan comes on before any code is downloaded. After compiling and downloading it see this error in setup:
Qwiic Blower Fan Example 1: Setting the Fan Speed
Device failed to setup - stopping
thoughts ?
The text was updated successfully, but these errors were encountered: