I just started working with a photon board late last night. Everything worked perfectly fine on the 3 boards I have.
2 are running 0.4.3 and one is running 0.6.0. I just updated EVERYTHING. I’ve gone through every single post I can find about lack of connectivity and nothing has solved my issues.
One thing I have not seen mentioned that seems to be causing my problems is SPI. I was running all kinds of little tinker stuff, basic LED on/off, 2 LEDs on/off, all the good hello world serial jazz.
As soon as I put SPI code on, it seems to have permanently broken all 3 of my photons. Not a single one can remain on a network for more than 5 seconds not exaggerating, it connects, I pick up my phone and open tinker, and it’s offline).
I am getting a solid green state. Only way for me to get to setup is to cut power all together and I have to reset while it’s starting. If I let it go for a bit then it enters the solid green state and it’s locked in there.
Are there any suggestions?
I have done the serial wifi, I’ve tried the 0.6.0 and 0.4.3 firmware versions, I’ve tried other networks, I have released and reclaimed. I saw that multiple networks saved can cause issues but at least 1 of the boards has only ever been on one network.
I read it might be an ISP issue but I have used my phone as a hotspot and the issue persists.
I’ve essentially got 3 very tiny, lightweight bricks and I need them for a school project.
Edit
Might have just solved my problem.
Through a 1 second delay in my code and it seems to be okay now. Might have been working too fast to handle the WiFi chip.
I’m troubleshooting so rather than a diagram I’ll summarize:
D5 ->CS
D6->separate CS
D4->SCK
The sensor has SDI/SDO on a single pin, so I have D3 going to the pin and D2 going to the pin across a 10k resistor (trying 4.7k once I get it up again).
depending on how it is setup your phone uses your router & isp net IP and tinker app uses that. while when you create a hotspot you might be creating a subnet which is like your phone becomes a new routing address. so if you photon is connected to the phone hotspot and then you start tinker the photon may be attempting to connect to competing addresses. this may be why the photon drops the hotspot as soon as you open tinker.
well, you seemed to be talking about the same device when you said it was connected to a network[you did not mention which network] and then when you started tinker, it disconnected. the best way to deal with problems is to isolate variables and in this case multiple networks are multiple variables. so to have only 1 network anything involved is connected to or could possibly connect to helps eliminate variables thus helping to isolate while trying to find the problem.
Sorry, not the DFU driver, the particler firmware manager claimed 0.6.0 is the latest version.
All of the code can be written “better.” Right now I just have it all segmented to more easily troubleshoot. As it’s my first time with photon I like to easily through a // and play around with stuff.
Are you aware of whether or not my SPI reading is the proper method?
Have you got the latest firmware manager? Older FWMs will not know about any more recent versions.
Are you using the bare sensor chip or are you using a breakout board?
If the latter which?
I haven't checked the datasheets of the sensor, but is it actually set for SPI (not I2C) and do the default SPI settings fit the sensors needs?
For SPI (default 4-wire mode - which I'd go for to start with) the sensor uses two seperate pins for SDI and SDO, only with I2C the I/O happens on the same pin.
You are correct. I am using the 0.6.0 firmware manager. It’s the one given on the firmware-manager page.
Do you have a link to the most recent one by any chance?
I used your update method but the CLI cannot determine my devices ID or firmware version.
The settings are yet to be determined. I was given a few hundred pages of documentation, claims seem to indicate it will function for I2C or SPI depending on bits set on the registers (which seems to be a chicken and the egg situation).
My question is regarding the photon IDE syntax mainly. Is setting a variable equal to the SPI.transaction(XXX) the proper way to read?
Also, going back to the original topic, even after the particle update command I still need to reflash as tinker and then reflash my code to get functionality. Without a serial tinker flash the device is bricked.
The sensor has it’s SDI, SDO, and SDA on one pin. If I am not mistaken that would mean SDA (I2C data), SDI (SPI input) and SDO (SPI output) are on a single pin.
I just confirmed the documentation lists it as 3 wire SPI
does not require the device ID, but a device connected via USB and in DFU Mode.
This is where Safe Mode will spare you the trouble to reflash Tinker.
Yes, this would be the syntax to read from SPI (uint8_t x = SPI1.transfer(0x00)).
Hence the question about your actual hardware (breakout vs. naked sensor).
Here is one of the available breakouts that indicates that setting CS pin HIGH activates I2C while pulling LOW makes it SPI.
If you've multiple possible causes for your issue, going back to the most basic version will help pinpointing the actual cause.
Hence
I did run the particle update. I was stating that I cannot view the firmware so I cannot confirm I am now on 0.6.2.
I’ll look into safemode. Thanks for the tip.
Thank you for syntax confirmation.
It is a breakout board, the documentation of the breakout board is claiming wither works but I am seeing discrepancies between the documentation and the board itself (for instance one lists the 2nd CS pin as accelerometer and the other lists it as the magnetometer). Going to be fun going through that.
The libraries may be handy, thanks for the links. I’ll review them in the morning, currently struggling as it’s 4 am. Was hoping to get the photon functional before the day really got going, hopefully the safemode tip will get me there soon.