App Inventor Authentication and Function calls/returns

I am trying to figure out how to build out a seemingly simple app to communicate with my Particle Argon (I am learning new IoT things on my own).

I am able to authenticate and make the LED turn on and off using CURL using both inline and HTTP authorization. However, I am unable to get the App Inventor to connect successfully with a confirmation.

At the simplest proof-of-concept level, I want to be able to tap a button, the LED goes to that state, and I get the confirmation into a label. Literally a GUI version of what CURL does.

Once that works, then I want to add a functionality using GPS coords. But i'm at the baby steps phase right now, and confused because all my googlefu is taking me to threads with old information or information that looks right, but I don't so much as get an error returned or anything.

My objective/hope is that whatever the function returns is what will show up in the ReturnVal label, hence the name of the label. It comes back in CURL as a JSON response, so to me that should be doable?

Screenshot 2025-02-22 at 1.53.34 AM

I'm not very familiar with AppInventor, but it looks like you're trying to call a function on the device. It looks like in one step you have a join of param= and global SwitchVar. When calling a function with URL encoded post data, it should be arg= instead of param=

OK, I have made alot of progress, but I am more confused now than when I started coding tonight's session because my location feedback loop is working, but the timestamp feedback loop (the original one) is not. The variables are posting to the Console as they should be, so I don't see that being the issue. I'm plum confused.

Background: I'm over 13 university laboratories in 2 buildings, plus I travel into at least 4 other buildings on campus for other tasks (like co-teaching and collaborating). The goal is to have a digital display on my office door, for which I can use this app I'm building to customize what it says in addition to automatically parsing which building (or at least what area of campus) I am in (or if my GPS is off-campus, it says so).

I'm just trying to babystep my way through learning how to do this.




I was able to get everything working how I wanted tonight. It was alot of reading and going "Why does X do Y?" over and over until I finally connected a bunch of dots.

4 Likes

Good work!!!

A large part of the issue was timing. Because I was writing so much I/O so quickly, it effectively was locking up the Argon.

I played with delay() in the hard code and that's how i figured out the timing issue, spreading things out. Then I was able to research clock() in App Inventor and utilize a timer for each step, spacing them out 150ms apart. For what I'm doing, the time "loss" is irrelevant - a 1-second latency is completely acceptable.