Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Robo-Tank Web App - Development
#53
Things are coming along however I did have a scare a couple days ago. I started adding custom rules to the backend, after adding just the variables needed the program no longer ran, it would crash after 10-30 seconds of running. Remove the extra variables that do nothing and it worked again, oh boy...

When it would shut down the program it said, segmentation fault, which suggests it was memory related which I fundamentally don't understand, it's very complicated. I managed to find a program called Valgrind that tested the memory and was worried when I saw the results, there were all kinds of memory leaks and errors that said something like this, how the heck is anyone supposed to know what this means haha.

==1912== Invalid read of size 8
==1912==    at 0x486B1DC: ??? (in /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so)
==1912==  Address 0x59d2640 is 8 bytes inside a block of size 10 alloc'd
==1912==    at 0x48486E8: malloc (vg_replace_malloc.c:380)
==1912==    by 0x48900F7: mysql_optionsv (in /usr/lib/arm-linux-gnueabihf/libmariadb.so.3)


It turns out I defined a lot of variables but didn't initialize them so basically there were pointers in the memory going to nothing. I don't think overall they were a problem as those variables were initialized before they were used but either way not good.

After fixing those then came time for the leaks in the memory heap, basically this means things would get written to the Pi memory and never released or cleared. With this happening it slowly uses up the memory on the Pi, because it has so much it was able to happen it but this can also cause havoc within the program which was happening when I added all the custom rule variables. The main problem here was some c++ functions I was using for date/time and a few others that weren't thread safe and would cause this exact thing, after replacing those functions with thread safe functions I was golden. After all this I added the custom rules variables where I started and no more crashing.  K05164 Whew, back on track and feeling great knowing everything in the memory is solid, wouldn't have been a good day if someone down the road pointed out the program had all kinds of memory issues. Now I'm starting to feel like I actually know what I'm doing.  K05111

Here's the summary, under the leak summary there were all kinds of lost bytes in all categories and they grew the longer it ran, it was a very sad moment to see it. There's still 504 bytes in possibly lost, this occurs during startup when either the the threads are started or the first read of the database, for sure it's no problem but yeah its definitely bugging me so I will be trying again later to eliminate it.

[Image: heap_summary.PNG]

Here's the list I posted a couple weeks ago, I crossed out what I've finished. Really only need custom rules, some logging, the dashboard auto update and I forgot to mention the "smart start procedure". This is a bit involved and the last step, it goes through all systems during startup so everything goes in the state it should be. When the "resume" button on dashboard is pressed this runs as well so everything goes back in auto mode. Then there's still a bunch of minor details which will take a couple days and then another big test of everything. I do heavy testing as I'm building so pretty confident things will be ok, just minor things I forget or miss here and there.
  • Add custom rules to backend (hard to estimate, around a week)
  • Email system UI and backend (looking like this will be a lot more trouble than expected with c++, maybe a week)
  • pH calibration, want something nice (2 days) 
  • Add a logging system starting with basic logs (1-2 days)
  • Add "manual" mode for AC outlets and DC ports (1 day)
  • Figure out a system to manage chart options (1 day)
  • Add auto/manual program update and backup feature (1 day)
  • Option to auto submit any errors to an specified email, could be me (1 day)
  • Add DC ports, dosing pumps and custom rules to existing scheduling system in backed (few hours - 1 day)
  • Add dashboard auto update for dosing vessels and light modes (couple hours)
  • Add upcoming schedule list in front end (1-2 days) Not really necessary though
  • Add smart start procedure
I don't have any new pics and can't post an update without so here's some "mobile" views. The width is 360px but they go down to 320px. The height is longer though. Sadly my Android phone is 6 years old and now not possible to open web app, can't open reef-pi either or anything else for that matter. Sad as the phone looks brand new, just can't update OS. So I've never actually tested on a mobile, I hope it works.

I do plan to have the header title disappear so there's room for the icons and as you can see lots of touch up needed. For the most part I've been focusing on the larger view and just making sure it fits small screens, will definitely be tweaking all these. Ignore the 32 degrees for room, reading DHT22 is time critical and I have the memory checker program running on the app so it runs slower and those don't work. Also the graphs are screwed up because it was down a couple days figuring out the issue.

[Image: mobile_1.png]
[Image: mobile_2.png]
[Image: mobile_3.png]
[-] The following 2 users Like Rob F's post:
  • albinochicken89, Weasel1960
Reply to top


Messages In This Thread
Robo-Tank Web App - Development - by Rob F - 04-18-2021, 12:41 AM
RE: Robo-Tank Web App - by tutuss21 - 04-18-2021, 01:26 AM
RE: Robo-Tank Web App - by JFReyes - 04-18-2021, 04:31 AM
RE: Robo-Tank Web App - by Jerry W - 04-18-2021, 11:00 AM
RE: Robo-Tank Web App - by Dom59 - 04-18-2021, 03:07 PM
RE: Robo-Tank Web App - by Rob F - 04-18-2021, 03:07 PM
RE: Robo-Tank Web App - by fred73 - 04-19-2021, 05:16 PM
RE: Robo-Tank Web App - by rott - 04-23-2021, 07:51 AM
RE: Robo-Tank Web App - by Dom59 - 04-23-2021, 10:31 AM
RE: Robo-Tank Web App - by Rob F - 04-23-2021, 11:11 AM
RE: Robo-Tank Web App - by loksik.lubos - 04-25-2021, 02:03 PM
RE: Robo-Tank Web App - by Rob F - 04-25-2021, 08:47 PM
RE: Robo-Tank Web App - by Rob F - 05-23-2021, 12:50 AM
RE: Robo-Tank Web App - by albinochicken89 - 06-13-2021, 12:30 PM
RE: Robo-Tank Web App - by Rob F - 06-13-2021, 06:54 PM
RE: Robo-Tank Web App - by rott - 06-19-2021, 07:38 PM
RE: Robo-Tank Web App - by Rob F - 06-19-2021, 07:41 PM
RE: Robo-Tank Web App - by rott - 06-20-2021, 03:05 PM
RE: Robo-Tank Web App - by Weasel1960 - 06-23-2021, 04:13 AM
RE: Robo-Tank Web App - by Rob F - 06-23-2021, 04:46 PM
RE: Robo-Tank Web App - by Rob F - 07-08-2021, 11:40 PM
RE: Robo-Tank Web App - by Weasel1960 - 07-11-2021, 04:59 PM
RE: Robo-Tank Web App - by Dom59 - 07-09-2021, 09:34 AM
RE: Robo-Tank Web App - by Rob F - 07-09-2021, 05:48 PM
RE: Robo-Tank Web App - by Rob F - 07-11-2021, 08:54 PM
RE: Robo-Tank Web App - by Rob F - 07-16-2021, 10:10 PM
RE: Robo-Tank Web App - by Weasel1960 - 07-22-2021, 09:07 PM
RE: Robo-Tank Web App - by Rob F - 07-22-2021, 09:58 PM
RE: Robo-Tank Web App - by Rob F - 07-29-2021, 12:37 AM
RE: Robo-Tank Web App - by Brooks - 07-29-2021, 12:56 PM
RE: Robo-Tank Web App - by albinochicken89 - 07-29-2021, 01:02 PM
RE: Robo-Tank Web App - by Rob F - 07-29-2021, 01:38 PM
RE: Robo-Tank Web App - by Rob F - 08-10-2021, 09:35 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 12:13 AM
RE: Robo-Tank Web App - by Brooks - 08-11-2021, 10:21 AM
RE: Robo-Tank Web App - by albinochicken89 - 08-11-2021, 02:24 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 04:36 PM
RE: Robo-Tank Web App - by deeproot - 08-11-2021, 09:24 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 10:30 PM
RE: Robo-Tank Web App - by deeproot - 08-11-2021, 10:41 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 11:11 PM
RE: Robo-Tank Web App - by zee_zout - 08-12-2021, 08:16 AM
RE: Robo-Tank Web App - by Rob F - 08-12-2021, 03:36 PM
RE: Robo-Tank Web App - by Rob F - 08-12-2021, 04:49 PM
RE: Robo-Tank Web App - by Weasel1960 - 08-13-2021, 07:25 AM
RE: Robo-Tank Web App - by Rob F - 08-13-2021, 01:55 PM
RE: Robo-Tank Web App - by Rob F - 08-17-2021, 12:15 AM
RE: Robo-Tank Web App - by Brooks - 08-25-2021, 04:01 AM
RE: Robo-Tank Web App - by Rob F - 08-25-2021, 08:19 PM
RE: Robo-Tank Web App - by deeproot - 08-25-2021, 11:05 PM
RE: Robo-Tank Web App - by Rob F - 08-26-2021, 01:05 AM
RE: Robo-Tank Web App - by Brooks - 08-26-2021, 10:53 AM
RE: Robo-Tank Web App - by Rob F - 08-29-2021, 12:20 AM
RE: Robo-Tank Web App - by Rob F - 08-30-2021, 10:47 PM
RE: Robo-Tank Web App - by deeproot - 08-30-2021, 11:08 PM
RE: Robo-Tank Web App - by Rob F - 08-30-2021, 11:16 PM
RE: Robo-Tank Web App - by deeproot - 08-30-2021, 11:32 PM
RE: Robo-Tank Web App - by Rob F - 08-30-2021, 11:58 PM
RE: Robo-Tank Web App - by Weasel1960 - 09-04-2021, 11:40 PM
RE: Robo-Tank Web App - by JFReyes - 08-31-2021, 06:00 AM
RE: Robo-Tank Web App - by Rob F - 08-31-2021, 09:48 AM
RE: Robo-Tank Web App - by coaxman - 08-31-2021, 01:25 PM
RE: Robo-Tank Web App - by Rob F - 08-31-2021, 03:48 PM
RE: Robo-Tank Web App - by deeproot - 08-31-2021, 11:42 PM
RE: Robo-Tank Web App - by Rob F - 09-01-2021, 06:58 AM
RE: Robo-Tank Web App - by Rob F - 09-05-2021, 09:06 AM
RE: Robo-Tank Web App - by Rob F - 09-09-2021, 09:20 PM
RE: Robo-Tank Web App - by Rob F - 09-09-2021, 10:06 PM
RE: Robo-Tank Web App - by coaxman - 09-10-2021, 06:07 PM
RE: Robo-Tank Web App - by Rob F - 09-10-2021, 07:54 PM
RE: Robo-Tank Web App - by Rob F - 09-10-2021, 08:13 PM
RE: Robo-Tank Web App - by Rob F - 09-11-2021, 07:41 PM
RE: Robo-Tank Web App - by Weasel1960 - 09-11-2021, 08:30 PM
RE: Robo-Tank Web App - by Rob F - 09-11-2021, 09:05 PM
RE: Robo-Tank Web App - by Rob F - 09-13-2021, 03:21 PM
RE: Robo-Tank Web App - by albinochicken89 - 09-13-2021, 04:17 PM
RE: Robo-Tank Web App - by Rob F - 09-13-2021, 04:51 PM
RE: Robo-Tank Web App - by pwest - 09-18-2021, 03:10 PM
RE: Robo-Tank Web App - by Rob F - 09-18-2021, 03:35 PM
RE: Robo-Tank Web App - by Rob F - 09-19-2021, 11:40 PM
RE: Robo-Tank Web App - by Brooks - 09-20-2021, 05:15 AM
RE: Robo-Tank Web App - by Dom59 - 09-20-2021, 10:59 AM
RE: Robo-Tank Web App - by Rob F - 09-20-2021, 03:13 PM
RE: Robo-Tank Web App - by Rob F - 09-27-2021, 01:23 AM
RE: Robo-Tank Web App - by Rob F - 09-29-2021, 09:14 PM
RE: Robo-Tank Web App - by fietsenrex - 10-01-2021, 07:18 AM
RE: Robo-Tank Web App - by Brooks - 10-01-2021, 07:22 AM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 09:40 AM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 10:29 AM
RE: Robo-Tank Web App - by fietsenrex - 10-01-2021, 10:49 AM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 11:49 AM
RE: Robo-Tank Web App - by fietsenrex - 10-01-2021, 01:03 PM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 07:27 PM
RE: Robo-Tank Web App - by Rob F - 10-08-2021, 10:48 AM
RE: Robo-Tank Web App - by albinochicken89 - 10-08-2021, 10:56 AM
RE: Robo-Tank Web App - by Rob F - 10-08-2021, 11:04 AM
RE: Robo-Tank Web App - by Dom59 - 10-08-2021, 12:01 PM
RE: Robo-Tank Web App - Development - by Rob F - 10-09-2021, 12:42 PM
RE: Robo-Tank Web App - Development - by Dom59 - 10-15-2021, 12:26 PM
RE: Robo-Tank Web App - Development - by Rob F - 10-15-2021, 12:33 PM
RE: Robo-Tank Web App - Development - by Dom59 - 10-15-2021, 12:39 PM
RE: Robo-Tank Web App - Development - by Rob F - 10-15-2021, 01:34 PM
RE: Robo-Tank Web App - Development - by Rob F - 12-18-2021, 02:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to Install Robo-Tank App Rob F 8 2,637 02-04-2024, 06:44 PM
Last Post: Rob F

Forum Jump:

Current time: 04-27-2024, 09:33 PM