Skip to content
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

Closed
JimKruk opened this issue Dec 27, 2021 · 23 comments
Closed

QWIIC BLOWER FAN EXAMPLE FAILS TO RUN #3

JimKruk opened this issue Dec 27, 2021 · 23 comments

Comments

@JimKruk
Copy link

JimKruk commented Dec 27, 2021

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 ?

@dlkeng
Copy link

dlkeng commented Dec 29, 2021

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.

@JimKruk
Copy link
Author

JimKruk commented Dec 29, 2021 via email

@JimKruk
Copy link
Author

JimKruk commented Dec 29, 2021 via email

@PaulZC
Copy link

PaulZC commented Dec 29, 2021

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 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

@dlkeng
Copy link

dlkeng commented Dec 29, 2021

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 "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.

@JimKruk
Copy link
Author

JimKruk commented Dec 29, 2021 via email

@JimKruk
Copy link
Author

JimKruk commented Dec 29, 2021 via email

@dlkeng
Copy link

dlkeng commented Dec 29, 2021

Jim,
Assuming you can get the I2C scan to find your Fan, for example:
I2C device found at address 0x40

then use:
if (Blower.begin(Wire, 0x40) == true)

in place of the default: if (Blower.begin() == true)

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.

@JimKruk
Copy link
Author

JimKruk commented Dec 29, 2021

Hi Dan
I commented out the //while (1); // Just sit and do nothing

The code continues but does not change the fane speed.

Scanning I2C devices...
I2C device found at address 0x48
1 I2C devices found
Qwiic Blower Fan Example 1: Setting the Fan Speed
Device failed to setup - stopping
Setting Fan Speed to 7000 RPM
Tachometer Reads 0 RPM
Tachometer Reads 0 RPM
Tachometer Reads 0 RPM

Setting Fan Speed to 1000 RPM
Tachometer Reads 0 RPM
Tachometer Reads 0 RPM
Tachometer Reads 0 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 ?
thanks

@dlkeng
Copy link

dlkeng commented Dec 29, 2021

Jim,
Sorry, I'm just a long time Sparkfun customer and product user. You'll have to contact Sparkfun Customer Support to get help in resolving the problem with your bad boards.

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!

@JimKruk
Copy link
Author

JimKruk commented Dec 29, 2021

Hi Dan
Ok, thanks for all your help, greatly appreciated ! I am disappointed in SF right now, they would not even look at the issue in their forums and told me to post here but I will reach out to their customer service team to setup a return.

@NPoole
Copy link
Collaborator

NPoole commented Dec 30, 2021

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, 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.

@JimKruk
Copy link
Author

JimKruk commented Dec 30, 2021 via email

@NPoole
Copy link
Collaborator

NPoole commented Dec 30, 2021

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

@JimKruk
Copy link
Author

JimKruk commented Dec 30, 2021 via email

@NPoole
Copy link
Collaborator

NPoole commented Jan 5, 2022

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.

@JimKruk
Copy link
Author

JimKruk commented Jan 5, 2022 via email

@NPoole
Copy link
Collaborator

NPoole commented Jan 5, 2022

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.

@JimKruk
Copy link
Author

JimKruk commented Jan 5, 2022 via email

@JimKruk
Copy link
Author

JimKruk commented Jan 6, 2022

Hi Nick
I received replacement fans today, order # 6900103, still not working, the i2c scan routine does not detect it. If it is a firmware update and something that is documented or someone has time to walk me through I am willing to try it vs mailing back and forth, let me know, thanks

@JimKruk
Copy link
Author

JimKruk commented Jan 7, 2022

Hi Nick
Russell just replied and said you would take the lead on this. If you want me to attempt updating firmware and can walk me through it I’ll try. I have no special hardware, etc but willing to try

@JimKruk
Copy link
Author

JimKruk commented Jan 10, 2022

Hi Nick
Was wondering if you were able to get an updated firmware to work ? I have four boards now if you want me to try and test something, thanks

@NPoole
Copy link
Collaborator

NPoole commented Jan 12, 2022

Hi Jim!
Sorry for the delay. The problem you have isn't that you got a firmware that doesn't work, but that you didn't get any firmware at all. As far as I can tell, we've somehow sent you a number of completely unprogrammed units.

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
Since you mentioned that you don't have a programmer on-hand, we're gonna use a Redboard (or other Uno-style Arduino board) as a programmer. The Arduino IDE actually includes the sketch for doing this as a Built-In Example.

ArduinoISP

Open this sketch and Upload it

Step 2) Attach the RedBoard to your Qwiic Fan Blower
Now you'll need to connect the RedBoard to the programming header on the Qwiic Blower Fan. The programming header is the 2x3 pin header on the backside of the board. I soldered pins to mine during firmware development, and this is the most reliable way, but you could theoretically just push header pins against it to make a temporary connection.

20220111_184702

Here is the pinout of the Qwiic Blower programming header. Pin 1 is the one marked with a line on the silkscreen:

Pin 1*: MISO  | Pin 2: 3.3V
Pin 3: SCK    | Pin 4: MOSI
Pin 5: D10    | Pin 6: GND

Step 3) Install the board package
Before you can program the Qwiic Blower, you'll need the Arduino Board Package for the attiny841 that the board is based on. You can do this through the Arduino Board Manager. Search "attinycore" and install the package as shown

boardsman

Step 4) Open the firmware in Arduino
You can find the firmware Arduino sketch in this repo. Either clone the repo or download the zip file and open "Qwiic_Fan_Controller" in the \Firmware directory.

Step 5) Set the board options
There are a number of options that need to be correctly selected in order for the firmware to be compiled for the correct target. Here is a screenshot of the correct options. Make sure your menu matches this (the COM port doesn't matter)

Step 6) Select "Arduino as ISP" as your programmer

ArduinoISP_Settings

Step 7) Run the "Burn Bootloader" option in the "Tools" menu
Even though we've selected the No Bootloader version of the board profile, we still need to run "Burn Bootloader" in order to setup the attiny chip according to the selections we made in the tools menu. It should take a few moments. If it's successful, you should see "avrdude done. Thank you." in the output pane. If it fails, check your wiring.

Step 8) Program the firmware
You should now be able to select the "Upload" or "Upload using Programmer" option and program the firmware to the board. This will take a few minutes because of the throughput limitations of the "Arduino as ISP" setup. Your output pane will look like this while it's writing:

ArduinoISP_Running

Once this is finished, the board should be programmed. If you decide to attempt this, please let me know how it goes.
I'm going to close this issue for now. If you wouldn't mind carrying on the conversation with me at Nick.Poole@SparkFun.com we'll continue to troubleshoot and hopefully get you some working units soon!

@NPoole NPoole closed this as completed Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants