Cellular.Signal throwing error

I’ve been using CellularSignal sig = Cellular.RSSI(); in a number of applications, so I can see how strong the cellular signal is for my Electrons. Workbench is throwing an error on this statement as I try to cloud compile one of my applications under Workbench.

I had not previously included the library #include "cellular_hal.h", but it seems that resolved the issue. Is this something I should provide moving forward?

Have you got #include <Particle.h> in your code?
What target version have you set?
(Dumb question follows) Have you set Electron as target platform?

I do not have #include <Particle.h> in my code. I thought I didn’t need that and I’ve never (?) used it in Dev. The target version is 7.0 and, yes, the platform is set to Electron.

BTW, a professor once told me the only “dumb” question is the one you don’t ask. :wink:

1 Like

Workbench is throwing an error on this statement as I try to cloud compile one of my applications under Workbench.

this looks like an intellisense error. are you actually able to successfully run the Particle: Cloud Compile command?

I had not previously included the library #include "cellular_hal.h", but it seems that resolved the issue. Is this something I should provide moving forward?

no, you shouldn't have to.

if you are comfortable sharing, i'd love to see your project source. PM me a link to a .zip or equivalent hosted on dropbox or similar :+1:

1 Like

@m_m, I don’t see the Message button for you. I’d be happy to send you a link to a file, as long as it’s not shared.

OK. So it seems I merely needed to put #include "Particle.h" at the top of my program and my issues are resolved. I’m a bit curious as to why this wasn’t required when I was using Dev. However, it appears to be a best practice, so I’ll do so in the future.

this looks like an intellisense error. are you actually able to successfully run the Particle: Cloud Compile command?

:point_up: can you answer this @ctmorrison

So it seems I merely needed to put #include "Particle.h" at the top of my program and my issues are resolved.

that's fine as a short-term workaround but smells like a bug as you shouldn't need to do that to have working & accurate intellisense support.

Yes, I can successfully run the Particle: Cloud Compile after the addition of #include "Particle.h" at the top of the program. Otherwise, it throws the subject error. What’s odd is that other applications don’t suffer from this. That’s what threw me for a loop (no pun intended).

to be clear, are you saying that both intellisense and the cloud compiler show errors when you DO NOT include #include "Particle.h" ?

i’m trying to understand where the problem lies: with our intellisense configuration or elsewhere. if it’s just an intellisense issue, you’ll see items in the “problems” tab (“View > Problems” from the main vscode menu) but your application will compile fine.

also if you can, please run the Particle: Audit Environment command (as shown here: Information: How to report bugs and provide feedback) and either PM me the results or share them here if they do not include sensitive info.

Yes, both show errors (see the first post in this thread for the IntelliSense error). The cloud compiler also throws an error. If I add the #include, the problem goes away.

Now here’s what I don’t understand…in order to send you more info, I commented out the #include "Particle.h" and I’m not seeing the errors and I’m 99.999% confident I did not make any other changes. I had been converting (importing) all of my may applications for Workbench and had two applications that had this issue. Now neither one does when I remove the include. Hmmmm…