SOLVED – Does `Spark.publish()` on the dashboard prevent from uploading again?

Does Spark.publish() on the dashboard prevent from uploading again?

I’m using this simple sketch to monitor temperature through the dashboard.

Problem is, I can’t upload a revised version of the sketch, even though particle list lists my Core.

I’ve tried:

  • using the online IDE
  • using command line compilation
  • using upload through WiFi
  • using upload through USB

The only solution so far is a factory reset and a re-initialsiation performed through USB.

Any hint?

Sketch

#define TMP102_SLAVE_ADDRESS 0b1001011

double fTemperature = 0;
long iTemperature = 0;

void setup()
{
    Wire.begin();
    
    pinMode(D7, OUTPUT);
    Spark.publish("temperature", String(fTemperature));
    
}

void loop() {
    
    Wire.beginTransmission(TMP102_SLAVE_ADDRESS);
    Wire.write(0x00);
    Wire.endTransmission();
    
    Wire.requestFrom(TMP102_SLAVE_ADDRESS, 2);
    Wire.endTransmission();
    
    Wire.beginTransmission(TMP102_SLAVE_ADDRESS);
    Wire.requestFrom(TMP102_SLAVE_ADDRESS, 2);
    iTemperature = (Wire.read() << 4) + (Wire.read() >> 4);
    
    Wire.endTransmission();
    if (iTemperature > 0b100000000000) iTemperature -= 4096;
    
    fTemperature = 0.0625 * iTemperature;
    
    digitalWrite(D7, HIGH);
    Spark.publish("temperature", String(fTemperature));
    digitalWrite(D7, LOW);
    
    delay(5000);
}

Publishing frequently on the Core seems to cause connectivity issues with the CC3000 when it has the 1.13 service pack or older.

The problem can be fixed by updating the CC3000 to the latest patch. You can get firmware to do that from https://github.com/spark/cc3000-patch-programmer/tree/ti-patch-1.14

Cheers, :smile:
mat.

1 Like

Thank you for your answer.

The last time I applied the CC3000 patch, it was even worse than before and I had to reverse-install the original version.

Is the new patch safer?

You’re welcome. I can only assume it’s safer - which patch did you install previously?

I know that the 1.14 patch specifically addresses the problem you’re seeing.

Patch 1.14 for CC3000 did the trick. Upload works fine now.

One question: Why the patch isn’t included in the OTA firmware update?

Thank you for your help!

After we rollout 0.4.5 for the core, we will look into making a new deep update to patch the CC3000.

I have the same problem with my Core. I did a “particle flash --usb cc3000” while in dfu mode. But I still have the same problem. Is this the correct method to get the correct patch installed? Or do I have to download the patch and specify it in the flash command? Thanks for your help.

You’ll need to download the patch from the link above and flash that.

Thanks very much for your reply mdma. I am very new to micro controller programming, so please forgive my lack of knowledge. I need some clarification about the process for installing the cc3000 patch. In regards to the exact file to download, is it the “cc3000 -patch-programmer.bin” file that I need. Do I put the file in the same directory as the dfu-util app and particle app? Do I then connect the Core to my usb port (on my Mac), put the Core in “dfu” mode and use the “particle flash --usb cc3000” command. Do I need to specify the name of the file to flash in my command string?

I have searched the documentation and posts here, but being new to the process, have not found the necessary details about the process. Thanks very much for your help.

Hi @mwman73,

Yes, you got it. These are the steps:

  • download the cc3000-patch-programmer.bin
  • put your Core in DFU mode
  • particle flash --usb cc3000-patch-programmer.bin

This will DFU the binary to your Core.

When the Core reboots, the LED will switch off. You then hold the setup button for a second and you’ll see the LED flash magenta for a while.

I hoep that helps! :smile:

Thanks mdma, I did as you instructed and it fix the problem. You guys are great! Quick response to my request for help, can’t ask for more than that!

You can also do it directly from CLI using particle flash --usb cc3000_1_14

1 Like

wow, I did not know that! ^^

I have seen SOS with the 1.14 driver - Invalid Case. So I think it is necessary to update the host driver too. I will make sure that is in for the 0.4.6 release, so that we can take steps to rolling out 1.14 to everyone via deep update.

1 Like