Forum Replies Created
-
AuthorPosts
-
In line 239/240 you’re missing the opening brace of the setup function. It should be
void setup() {
with that opening curly brace. You can put the curly brace right after the parenthesis on line 239 or by itself on line 240.
Missing braces and semi-colons are such a pain. The error messages they usually cause don’t help much.
Also, your code is missing the “loop()” function – it will set everything up and then do nothing. You probably want to add this loop (just paste it at the end of your current code):
C++123456789101112131415161718192021222324// ==========================================================================// Main loop function// ==========================================================================// Use this short loop for simple data logging and sendingvoid loop(){// Note: Please change these battery voltages to match your battery// At very low battery, just go back to sleepif (getBatteryVoltage() < 3.4){dataLogger.systemSleep();}// At moderate voltage, log data but don't send it over the modemelse if (getBatteryVoltage() < 3.55){dataLogger.logData();}// If the battery is good, send the data to the worldelse{dataLogger.logDataAndPublish();}}You didn’t post the screenshot of the
pio lib install
so I’m not sure what’s happening there.
Try installing the libraries one after the other using these commands:
pio lib install EnviroDIY_ModularSensors
pio lib install https://github.com/PaulStroffregen/AltSoftSerial.git
pio lib install https://github.com/SRGDamia1/NeoSWSerial.git
pio lib install https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.git
pio lib install https://github.com/switchdoclabs/SDL_Arduino_SSD1306.git
I’m not sure if you need all of them, but it shouldn’t hurt to have them installed.
As a beginner, I would suggest you pick either Atom OR VS Code – whichever one feels most intuitive to you – and use that one exclusively rather than attempting to flip back and forth between them. Both editors will give you exactly the same tools for PlatformIO, but the menus and drop-downs and styling are different. Rather than try to to remember how each is different, just pick one.
Copying only an h file into your directory is *not* the proper way to install a library. You should list the library in the “lib_deps” section of your platformio.ini and run the command
pio lib install
which should install the libraries listed in that section and their dependencies or you can install a single library with the command
pio lib install xxx
replacing xxx with either the name of the library or the location of a git repository.
The most recent version of PlatformIO also has a point-and-click style (gui) library manager available through the platformio home menu. See this for more information on that: https://docs.platformio.org/en/latest/librarymanager/
I added screen shots of how you get to the home in Atom and VSCode.
Attachments:
pio lib uninstall xxx
would mean “uninstall the library named xxx”. You’d replace the “xxx” with the name of whatever library you’re trying to uninstall. All of the documentation and examples use “xxx” meaning “replace this part with your own text”.I put up screen shots with the locations of buttons to open a new terminal.
Attachments:
Huh. I don’t have any *good* suggestions, but he’s a hodgepodge of things to check :
You have to use bypass or USB direct to be able to use those commands, transparent/command mode won’t work. Can you get normal responses to other commands? (ie AT – OK; ATI – modem info) Do you have your SIM card installed? The file being cleared is on the SIM card, so it has to be installed. Do you have CFUN set to something other than 0=minimum functionality? At minimum functionality it may not be able to communicate properly with the SIM. Did you try USB direct? With the TH board you can use the side micro USB port for that – keep the USB-c plugged in for power, flip the dip switches by the micro USB both toward the plug, and then use xctu to set device options bit 2 (check the help it might be bit 4 for software usb direct enable) and enable USB direct communication on pin 7 (dio1?).
There’s probably a missing semi-colon or brace in your program code somewhere right above line 215.
Check first where you pasted in the UUID’s. Each UUID should be enclosed with quotation marks, there should be a semicolon after both the registration token and the sampling feature and a comma after each UUID/variable in the UUID list.
You can also check for matching braces by clicking each starting brace/parenthesis. VSCode should highlight its corresponding closing brace so you can see if they’re closed appropriately.
Delete lines 112-117 of the code I posted.
Huh. It’s an “access is denied” error. I’m guessing two processes tried to write to the same temporary folder – the automatic “check for new libraries in the library folder” process and the manual install probably collided. Did you get the same error multiple times after exiting and reopening?
😛 In double checking what the number would be for Verizon when it appears on the FPLMN, the very first google hit I got was an issue with someone else trying to force a Hologram SIM to use Verizon: https://github.com/botletics/SIM7000-LTE-Shield/issues/163 Per that thread from just a few days ago, others suspect that Verizon has just very recently clamped down again booting out most Hologram users.
Are you totally sure you can’t just use the weak AT&T signal? What about T-Mobile? (As a T-Mobile subscriber, I’m dubious that there’s anywhere that T-Mobile exits and not AT&T.) You might be able to hop to T-Mobile by using bypass and setting the UMNOPROF to 5. I haven’t ever tried it and you might be denied by the network, but here’s a chunk of code you can add to your setup that might work:
C++1234567891011121314151617181920212223242526272829// Extra modem set-upSerial.println(F("Waking modem and setting Cellular Carrier Options..."));modem.modemWake(); // NOTE: This will also set up the modem// Turn off the cellular radio while making network changesmodem.gsmModem.sendAT(GF("+CFUN=0"));modem.gsmModem.waitResponse();// Mobile Network Operator Profile - 0 = SW default// - 1 = SIM ICCID selected// - 2: ATT// - 6: China Telecom// - 100: Standard Europe// - 4: Telstra// - 5: T-Mobile US// - 19: Vodafone// - 3: Verizon// - 31: Deutsche Telekommodem.gsmModem.sendAT(GF("+UMNOPROF="), 5);modem.gsmModem.waitResponse();// Selected network technology - 7: LTE Cat.M1// - 8: LTE Cat.NB1// Fallback network technology - 7: LTE Cat.M1// - 8: LTE Cat.NB1// NOTE: As of 2020 in the USA, AT&T and Verizon only use LTE-M// T-Mobile uses NB-IOT// modem.gsmModem.sendAT(GF("+URAT="), 7, ',', 8);// modem.gsmModem.waitResponse();// Restart the module to apply changesmodem.gsmModem.sendAT(GF("+CFUN=1,1"));modem.gsmModem.waitResponse(10000L); -
AuthorPosts