Air Player Config Backup

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Post Reply
Message
Author
P51Eagle
Posts: 22
Joined: Sun Jan 06, 2019 9:32 pm

Air Player Config Backup

#1 Post by P51Eagle »

Hi All,

While I'm really enjoying working with AP on my first sim project. I will have to say that twice now I've lost config's for two of my Pi's and have needed to reconfigure them. The first time was admittedly my fault because I was new to this software and inadvertently removed a panel and saved over the config.

The other however was not my doing, instead it was after I attached an Arduino to one of my established and working Pi's to add LED's to my switch panel. I was editing and testing new LED LUA code from within the editor part of APM 3.5.3; and to test you have to select a Pi with the proper hardware. This will then overwrite any panel code on the selected Pi. Of course this makes sense as the Pi has the hardware you want to test. However, there isn't a way to backup your panels before they're overwrite.

So once I was finished testing I went to re-save the original panel and in my case the Pi lost it's connection in the middle of it's saving. So my only recourse was to restart the Pi and attempt to get it connected. It did reconnect, but my panel was gone and the Pi no longer showed the name I'd assigned it within the device view in APM. It just shown the IP of the Pi. Any attempt at saving or creating a new panel failed. Then to my realization, the panel was gone. :o

It had seemed to me when first working with APM software, the panel configurations were saved on the PC and uploaded to the Pi upon using the save command, but I guess this is not true. Am I correct in this? So in a sense there's two locations that store the config's; Pi and PC.

In any event, a backup feature, or better yet to have the Pi's panel config's saved on the local PC when changes are made would be ideal. Or both.

Having this feature would save a lot of recreation time especially if one doesn't document port assignments, gauge layouts, etc.. It could also be used when upgrading software.

BTW, I have placed a support ticket for my broken Pi, but thought to sending this post here for comments.

Thanks for considering.

Kevin G.
Sincerely,

Kevin
First time build C172

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: Air Player Config Backup

#2 Post by Corjan »

Hi Kevin,


You are right, there isn't a way to backup the configuration. And configuration is also not stored by AM itself.
You can however clone panels from an AP instance to AM. Go to the first tab, and select clone, and clone from an AP panel. You can also do this the other way around when AP configuration is lost.

In theory, this shouldn't be needed when the AP software works :). I'd like to get to the bottom of why the Pi crashes for you.
Do you know of a way to trigger the problems on the Pi? Maybe when you start a specific instrument or panel etc.


Sorry for the trouble,

Corjan

P51Eagle
Posts: 22
Joined: Sun Jan 06, 2019 9:32 pm

Re: Air Player Config Backup

#3 Post by P51Eagle »

Hi Corjan,

Cloning is a work around, but doesn't really address a true Pi backup with properties but agree that it's a good way for a panel. What gets frustrating is I only have limited time to work on my sim and when things go poof, it can really set things back. Thus my need for a way to get things back as quickly as possible.

In my examples from my previous post, the first was my doing, the second I can't replicate because I can't event get the Pi to receive any new panels after the crash. I have a ticket in, but haven't received any response yet. There must be something else going on because I can't resave a new panel to the Pi. In fact the AM software won't even load the list of panels for me to select from for this specific Pi. I fear that I'll need to start over with this Pi, but then that will create a licensing issue and the last time that happened, all my licenses had to be released and renewed . Kind of a pain.

However, I'm a database programmer by trade and noticed that SQLite is used as apart of the software system. So I did a little digging on my own. It looks like all the data tables on the Pi are showing schema but no data. So something catastrophic happed when the Pi lost it's connection during the saving process and wiped out the data. I've attached an image of the empty tables.

While writing this I think I know what happened. If you are testing a Pi with a new script in the editing part of the AM application and save this script to a Pi that already has good panels and configuration, saving will wipeout the panels and configuration as I was doing. Unless you resave your good panels and configuration back to the Pi before closing the AM software, you will loose your good panels and configuration which must be held in the application memory.

I believe this is what happened to me, because when the Pi lost it's connect with my main computer (which I haven't seen yet until yesterday,) I rebooted the Pi and then as a next troubleshooting step I restarted the AM application without thinking about loosing the config in memory. This could explain why the DB's are empty; being cleared first on a save process but then not being filled because of the connect loss.

Would be nice if during the save process the data is backed up locally, then uploaded into temp tables on the Pi and then moved upon successful data transfer. This way you have a recovery process if needed which could be automatic. Considering that things are stored in DB, should be pretty easy to add a backup feature I would think.

Is there a logging feature that can be turned on for troubleshooting? I'd love to help, but without a log, not much else to go by.
Attachments
database1.png
Sincerely,

Kevin
First time build C172

SimPassion
Posts: 5339
Joined: Thu Jul 27, 2017 12:22 am

Re: Air Player Config Backup

#4 Post by SimPassion »

+100
Agree that this will be cool to get a temp local backup of config sent previously to Air Player
It was my case with Air Player Desktop, where I needed to retrieve the configuration and avoid redoing the whole panels and instrument placement and resizing

Gilles

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Air Player Config Backup

#5 Post by Sling »

I personally wouldn’t use AM and AP the way you are. AP is mainly a display program for showing your panels. AM is the place to do your development. You will get much better results if you solely develop on the AM platform with your hardware connected for testing. When you are happy and the development has finished it can be uploaded to AP.

The development time is much quicker too.

Just my 2 cents.

Tony

SimPassion
Posts: 5339
Joined: Thu Jul 27, 2017 12:22 am

Re: Air Player Config Backup

#6 Post by SimPassion »

I agree it's faster Tony, though sometime more comfortable to use a remote AP to avoid to continuously switching from the sim and the instrument/AM UI with running from Create/Edit tab

Gilles

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: Air Player Config Backup

#7 Post by Corjan »

Hi,


Air Manager indeed creates a local copy of the AM configuration. That is the one you are configuring when you add/remove panels.
If you don't save at some point, you will loose your changes.

I still want to change that system, where it will commit any change made directly to the Pi. This will be quite a change to the code, so don't expect that soon.

In my eyes, the core problem here is that for some reason the Pi looses its configuration for you. I feel not having a backup system is not a big deal when that has been sorted.
I will respond to your ticket, and hopefully find the core issue here.

Note that you can always manually backup the configuration. It is stored at "/root/Air Player/config.sqlite3". Or maybe even easier is to backup the complete SD card :).


Corjan

P51Eagle
Posts: 22
Joined: Sun Jan 06, 2019 9:32 pm

Re: Air Player Config Backup

#8 Post by P51Eagle »

Hi Corjan,

Correct me if I'm wrong, but saving to the local PC for display will save it local, but if I save it to the Pi for display it is only on the Pi? As far as me manually saving the db, yes I've already thought of that, but that would be many more steps for me to connect to the Pi and down load the db file as well as uploading the file if I needed to. Backing up the disk is a pain as well because I have the Pi's mounted and getting to the disc bay is not easy. It seams that you already have the mechanics implemented in your software that it would make much more sense for AM to have this as a feature.

Tony,
I should explain that I'm using three Pi's for my sim with one Arduino attached to a Pi for extra ports. All my gauges are being displayed using AM and AP on three small LED HDMI panels built into the control panel for the most realistic sim experience. I have a projector (eventually will be three) displaying XP front view without a cockpit and no other means of seeing my gauges, so all panels are actually stored on the Pi's.

So I am using AM for development, sorry Tony but I'm not sure I understand comment. I'm very new to this system (about 6 months or so) so I'm starting off using in a very easy sense. Meaning that I'm selecting my Pi with a selected color for a background to display the instrument, then attaching an instrument. This was my beginning. Now I'm advancing by adding custom lua scripts and adding them to the Pi panel for switch and dial control. This is all being done in the Edit area of AM desktop; I will add that I use Notepad++ with a Lua plugin for editing, but paste it into the AM edit window to run. So because I'm only developing for the Pi, everything is only sent to and saved on the Pi.

I've tried to locate online information on best practices for creating panels for a Pi, but mostly what I've seen is using monitors attached to the AM PC. I'm open to suggestions if I'm not using the software as intended.

I've attached a couple of images of the control panel and sim. Pardon my temporary PVC yoke wheel's; they will eventually be real ones, but they do the job for now. I'll also point out that I've create a C172 yoke system, so both yoke actually work as in a real C172.

The sim is far from complete, but without the AM software would not be possible!
Attachments
IMG_20190429_191837.jpg
IMG_20190420_180354.jpg
Sincerely,

Kevin
First time build C172

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Air Player Config Backup

#9 Post by Sling »

Thanks for the background that helps a lot in understanding what your setup is. If you are pushing new code onto the Pi everytime you make changes before testing and tweaking in AM this would explain the time consuming issue and perhaps some of your issues.

You should prove all your code in the dev environment before unloading to the pi’s so you get the benefits of the console, debugging and other dev tools contained within the Create/Edit tab. If you upload straight to the Pi you have no way of knowing if the code is good.

By the way there is no developing only for the Pi. What you develop can be run on any of the platforms AM supports. The only exception is hardware because not all hardware (namely the tablets) can have an Arduino attached.

Please correct me if my interpretation of what you are doing is a bit off.

Here to help.

Tony

Post Reply