sqfmi / badgy

Home of Badgy - IoT Badge

Home Page:http://badgy.sqfmi.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'WiFiManager' was not declared in this scope

SciaticNerd opened this issue · comments

Hi there! I'm trying this out for the first time... all of it. I'm following the 'getting started' type info

  1. First from the 'compiling examples' info at: https://github.com/sqfmi/badgy
  2. and then following the setup section in: https://github.com/sqfmi/badgy/tree/master/examples
  3. before getting the following error when trying to compile:
    https://github.com/sqfmi/badgy/blob/master/examples/hello/hello.ino

Just copied the text from the hello section and pasted it into the IDE and changed it to be my handle. Is there another way this is supposed to be done?

----------------------- begin error text copied from Arduino IDE ------------------
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

hello:111:25: error: variable or field 'configModeCallback' declared void

void configModeCallback (WiFiManager *myWiFiManager){

                     ^

hello:111:25: error: 'WiFiManager' was not declared in this scope

hello:111:38: error: 'myWiFiManager' was not declared in this scope

void configModeCallback (WiFiManager *myWiFiManager){

                                  ^

C:\Users\Admin\Documents\Arduino\Badgy\Hello\hello.h\hello.ino: In function 'void setup()':

hello:51:31: error: 'configModeCallback' was not declared in this scope

 wifiManager.setAPCallback(configModeCallback);

                           ^

exit status 1
variable or field 'configModeCallback' declared void

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
-------------------- end error dump -------------------

Using Arduino 1.8.9 (Windows Store 1.8.21.0)

Thanks for any help in advance!

Respectfully,

SciaticNerd

Please don't paste all the debug code, that's a huge amount of waffle! But the first lines should help you - it's showing 4mb, no spiffs. You need to change the board options to 1mb spiffs to allow you to save config info such as wifi data etc.

I am assuming you have WiFi Manager library installed for your Arduino IDE setup, but worth asking?

Steve

So it DOES matter... compiled just fine using git.... glad to have been able to learn and will share this for other folks just starting out:

install git
Create a folder
launch a command line
navigate to the folder you just made
git clone https://github.com/sqfmi/badgy
this will create a local copy of folders for badgy to the local computer
now open the hello.ino file in the arduino IDE
change the name from "badgy" to your chosen name.

Those with newer models of the Badgy IoT can use the Arduino IDE to compile and it will push the update to the connected device.

If uploading the code using WiFI
From inside the Ardunio IDE...
click on Sketch > Export compiled binary (this is the way I know this works as far as I know right now)
go find the outputted file in
C:\Users<YourAccountNameHere>\AppData\Local\Temp\arduino_build_ <--- Look for the folder with the closest time to when you clicked Compile
locate the file called 'build.ino.bin'
Now you're ready to install this to your badgy iot device!

Connect the Badgy to power (battery or a USB cable connected to a computer or power source)
Holding the badgy so the screen is facing you, move the switch into the up position (OFF)
Press and hold the joystick button like a button and move the switch down (ON)
let go of the button when the display changes to words about how to connect

If this is the first time the badgy is being set up, its WiFi will need to be configured
follow the on screen prompts on the device

If WiFi has already been configured, the badgy will display a URL
Now open a web browser and navigate to the address displayed on the Badgy's screen.
Click on "Choose File" on the web page portion of the screen
Select the .bin file located earlier in the export binary step and click "Open"
Click update and watch it go! (the page will be 'not found' after the device reboots)
The Badgy will now update and reboot itself!

Like what you see on the screen? Great!
The Badgy will run on either a LIR2450 coin cell or 1S LiPoa battery - just make sure the battery is inserted matching the symbol on the little metal piece that holds it
(in other words - if the metal shows a plus, then make sure the matching shape is facing you when inserting the battery)
So flip the power switch to the down position (OFF) to save power and leave the eInk display showing the "Hello my name is" message!

My name needs to be centered in order to fit, but it works now, so I'll close the ticket.
tl;dr: Clone the example files with git instead of copy and pasting and things compiled just fine.

Thanks much!
Steven
@SciaticNerd

Please don't paste all the debug code, that's a huge amount of waffle! But the first lines should help you - it's showing 4mb, no spiffs. You need to change the board options to 1mb spiffs to allow you to save config info such as wifi data etc.

I am assuming you have WiFi Manager library installed for your Arduino IDE setup, but worth asking?

Steve

Hadn't thought it would be so ginormous... Deleted.
Definitely had the libs installed... being so new, I tried to copy/paste from github instead of using 'git clone'
Used git > changed name > compiled without incident...

I still have no idea what I'm doing, but still succeeded, so I'm counting it a win! :-D

Glad you sorted it. A GIT clone and a copy and paste is the same really as this isn't a library or needs to be installed with other files from the same repo. But at least you're up and running - get learning, get tinkering, enjoy!