EDsteve / ELOC-Control-Panel

Will be open source later. But maybe better do private now
MIT License
0 stars 1 forks source link

Implement new Bluetooth API format and additional tasks #14

Open EDsteve opened 11 months ago

EDsteve commented 11 months ago

Hi,

I am guessing that will also "fix" some of the issues/requironments:

Status page:

ELOC Settings:

Extra

This Table shows all points listed in Recording and Detection Status page: 🎙️ ⚙️ Possibilities
Status
SD card Space Available 100GB
Battery Level 0-100%
GPS Accuracy 10m
Detecting/Recording since 1d 5h 10m
Detector Settings
Record When Detected ON, OFF
Model Trumpet_V12
Communication OFF,LoRa, WiFi, Mobile
Recorder Settings
Sample Rate 16000
Hous per file 0.2
Gain LOW,HIGH
MISC
Grid ID Riv12
Battery Type LiFePo4
Battery Volt 3.23
Session ID ELOC5111212987
~Last GPS Accuracy~ 5m
~Last GPS Location~
Uptime 1d 5h 10m
Detect/Record Since Boot 1d 5h 10m
Bluetooth during Detecting ON, OFF
Microphone Type ICS-43434
Firmware ver0.1
App version ver0.1


I imagine a design like this. Feel free to adjust as you wish. But you get the idea.

APP_NEW55

EDsteve commented 10 months ago

@josephx86 We are getting close. Would like to have a few changes though and hope i am not "too German" about it. :D

New feature:

UI adjustments

Functions

But please let me know if you think some changes are too "oldschool" or make it worse.

UI_changes

josephx86 commented 9 months ago

I have applied fixes for most of the issues. What remains is the new feature, the SD card issue, and also the shadows for the light shadows.

Please pull the changes and test.

EDsteve commented 9 months ago

Wow. Cool. Thanks for the update. Not sure about the shadows anyway. Maybe they make it look too heavy. So not a problem if not. I guess :) Arrg. Forgot to bring my files and cant't compile without them. So the testing has to wait till i am back home in a few days.

EDsteve commented 9 months ago

@josephx86 Niiice. You also changed some fonts with the last commit. Looks better. I like it. The ELOC 3.2 should arrive within the next 12 days at your home according to EMS shipping. Took a while to find a shipping company that ships electronics abroad from Thailand. Not sure why they make such a fuss about it.

As usual i have a new list for you :) Sorry for asking you to code using AnyDesk. But would be good if we can fix the commands and settings first (Unfortunately, but hopefully before the ELOC arrives). Let me know when you are free. So i am finally able to test the app and the firmware. And also let other test it.

What are your thoughts about the automatic upload feature? Is that something complex? If yes we can maybe make an automatic upload whenever the app opens and after someone presses "Start Recording". SD card inside No SD card
image image
EDsteve commented 9 months ago

@josephx86 I haven new items which needs to be solved:

To make settings work with setConfig. These parameters are available.

The new Micbitshift.

Margin and shadow problems: image

EDsteve commented 8 months ago

@josephx86 Happy to say that it works pretty well so far :) Only Sign up with Google doesn't work yet.

Another thing: The app crashes often during connecting to a device which just woke up BT during recording/detecting (knock twice on the table next to the ELOC to reactive BT) Need to investigate further. But i think the problem is probably on the Firmware side because BT has lower priority during recording/detecting. Have you experienced a similar behaviour? If you have an idea about it. Let me know.

josephx86 commented 8 months ago

I have not yet noticed the connection issue. I will test that scenario.

I am going over the Google Sign In and should be done in a few days.

EDsteve commented 8 months ago

@josephx86 "Luckily" it just happened again (even without recording/detecting) and i catched the error in the serial log (firmware side): E (1814553) BT_HCI: command_timed_out hci layer timeout waiting for response to a command. opcode: 0x40f

This is part of the log: App crashes with BT Error in Log_ Commit_9249779.txt

Does that help to find out if it's Firmware or App?

EDsteve commented 8 months ago

But sometimes it crashes without an error in the log. This time I could connect sucessfully, but then the app crashed. This is the log: App crashes while connected to ELOC - no error in log.txt

josephx86 commented 8 months ago

Reading the logs, it looks like a firmware issue. All the same, the app must not crash - I will make the app either keep trying to connect or display a connection error message to notify the user.

EDsteve commented 7 months ago

@josephx86 Another job :) Since the JSON implementation (getStatus.json and getConfig.json), the txt file for upload eloc status is not working any more and it would make more sense to use the JSON files directly instead. With that change i would also prefer to store the data in Firestore instead of a MySQL server. The elocMAP needs to change the query for that reason. But i think it's worth the effort. 

The idea is to have metadata from every ELOC in a database. Every time a BT connection to the ELOC is made or a mode change has happened (Start recording, start detecting, etc...), these two json files should be stored locally on the phone (overwritten if already exist) and then uploaded to Firestore once internet is available (similar as it works now with upload eloc status).

Two values are missing in the JSON files and need to be added from the app:

The time of file-creation should be stored in Firestore as well. What would be the best way? Store the creation-timestamp as a new element in each JSON file or in the filename itself? Whatever makes things easier for you.

The files could be named as follows: DeviceName_getStatus.json For example:

Is that something you can do? If you have suggestions to improve this. Feel free to let me know :)

EDsteve commented 7 months ago

@josephx86 My explanation is a bit confusing i think. haha Basically the getStatus.json and getConfig.json values should be saved on the phone and then stored to Firestore so it can be querried and shown in a table similar to this one.

josephx86 commented 7 months ago

I did understand the explanation. The JSON from the ELOC has some extra information that is not used in the table you referenced. Do you want to upload all the JSON data from the ELOC or should we upload only the relevant fields (timestamp, ranger name, device name, battery volts, rectime, gps accuracy, gps location, id)?

If you are not concerned with the amount of data written to firestore, then we can just upload all data as it comes from the ELOC. But it we want to keep the data stored/uploaded at a minimum, we can easily recreate the JSON to have only the data that is actually needed.

EDsteve commented 7 months ago

@josephx86 The table i linked before is just an example and i think i want to add some more info in it. Still have to think about which ones to add :) I would store all JSON data and then just query only the required fields for the table.