Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: Hacking my new SafePet Rotating Litter Box for Cats

Hacking my new SafePet Rotating Litter Box for Cats 2 months 4 weeks ago #18104

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 492
  • Thanks received: 46
In spite of the high number of views on this thread, I never see any comments except from Jon, which is enough for me by the way. So in the spirit of what this thread was designed for, I am posting and making a note to myself for future development for this project template.

OTA - I already have tried it with the ESP8266, but need to expand it to include the slave MCU's that are also part of this project, and any other that spawns from this framework. With a 16mb flash size on my selected ESP8266 board of choice, it should be easy to store and buffer firmware for the STM32F103C's that are attached. The trick is to route the firmware to the desired device, and to be able to emulate SWD to those boards. I will also have to include additional protocols for other devices I might use... ATMEGA328P, even PIC (let's see if I remember) pic32mx795f512l. I hope I got that right! The manager of my projects, the ESP8266 and later the ESP32 has to be able to receive multiple firmware files from my wireless network and then program the subsystems in my projects.

There is lots to do on this idea but certainly possible. Speed really isn't an issue considering the size of the firmware files for the subsystems, as long as it doesn't take 10 minutes or something rude like that. The idea of course is not having to pull the board and have to plug into it with a laptop or my desktop PC, but rather stay in place and have it's new ideas blown into it over wireless.

That's for after this project though. Stay tuned!
Last Edit: 2 months 4 weeks ago by hop. Reason: typos

Hacking my new SafePet Rotating Litter Box for Cats 2 months 3 weeks ago #18105

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 492
  • Thanks received: 46
I absolutely LOVE Python, specifically, Python 3.7!! It has been somewhat of a distraction really, but what I learned this weekend is definitely going to help this project, and the ones to be spawned from it!

I haven't really decided on a language for the embedded system projects daemon that will be running on the IoT Debian Linux server yet. I was dead-set on C++ until this weekend. The web-applications will most likely be a mix of languages... JS, JQUERY, CGI, PHP, HTML5... but the core hive mind will quite likely include Python3 to some extent. I haven't had time to research Python3 support for MQTT yet but I'm sure it is extensive also.

Of course, the operational model for this hasn't changed for me. The hive mind server will have ultimate control, like a CEO. But the systems and subsystems in the projects will have autonomy to work on their own at each level to the extent of their abilities. It's all so clear, if not simple, now. This is a very exciting time!

So back to the project. With a communications hierarchy in place, it will soon be time to put the prototype to work and expand-ability tested as new features are gradually added and deployed using the core framework. And then let the testing begin! FINALLY!!! And the countless hours documenting all this stuff! YAY! :dry:

Hacking my new SafePet Rotating Litter Box for Cats 2 months 3 weeks ago #18107

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 492
  • Thanks received: 46
I am trying to use interrupt handling to disable (and leave floating) the serial pins used to communicate between the ESP8266 and the blue pill STM32F103C board. This needs to be done on the blue pill board. The problem is when the serial pins are connected between the two, I cannot flash the firmware in the ESP8266. The solution is to use a GPIO pin of the ESP8266 Wemos D1 Mini Pro board to trigger an interrupt on the blue pill. But I am finding mixed info on the state of the Wemos board GPIO pin states during reset and programming.

I will have to pull out the DSO for this I guess. It is the only way to be sure. This way, can see the state of the pin I selected, D8, all the way through firmware programming, reset, and normal operation. More when I do it.

Hacking my new SafePet Rotating Litter Box for Cats 2 months 3 weeks ago #18108

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 492
  • Thanks received: 46
In the ESP8266, I coded for a GPIO pin (D8) to go high when it is running normally. It goes immediately low when flashing it. I also coded the blue pill to react to this control signal line (input - pull down) on rising and falling edges of that signal. On a rising edge, the serial port is disabled, but I did not code to turn the pins to inputs-floating when a falling edge was detected by the IRQ handler. This might be why it is not working yet as expected. That is my next task.

Again, I have to say, programming in PlatformIO installed on VS Code is absolutely amazing! I can switch platforms on the fly and write code in both and flash the one I am working on by simply switching tabs in the IDE. It's WONDERFUL!

Hacking my new SafePet Rotating Litter Box for Cats 2 months 3 weeks ago #18109

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 492
  • Thanks received: 46
MAN! Word to the wise!!! Never underestimate the value of two equal signs... as in "==" versus "="!!!!!

I have been chasing my tail for about 2 hours now trying to figure out why my IRQ handler was not working. All because of a "IF" statement that has one equal sign, as in
if(serial_enable_flag_trigger=true){
     //do some stuff
}

The comparison has to be two equals, as in
if(serial_enable_flag_trigger==true){
     //do some stuff
}
Or the comparison never becomes true. To be honest, and even though I know my way around C++ somewhat, I cannot even envision a reason that one equal operator even works in this context. It's like saying "If my variable will now equal what I entered" but even that fails the test.
Last Edit: 2 months 3 weeks ago by hop. Reason: Code markers hosed

Hacking my new SafePet Rotating Litter Box for Cats 2 months 2 weeks ago #18110

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 492
  • Thanks received: 46
SPIFFS!

No, I'm not having a fit, SPIFFS stands for Serial Peripheral Interface Flash File System and is not altered when a new program is flashed to the, well, flash memory. It can be used for all sorts of things, including configuration data, settings, whatever. Since my Wemos ESP8266 d1 pro mini has 16mb of space, this turns out to be one heck of a resource!

I just bought a clue and read about what it is, how to use it, and already coding to save my pre-connection messages there to unload when a connection is established. This will also be VERY helpful to store web pages to serve up as a web interface for each project. This is very exciting!!!

I already knew that somehow, I was going to be able to use the SPIFFS for firmware files to use to program (flash) the sub systems, but I did not connect the dots about all the other uses until just now. YAY!
Time to create page: 0.239 seconds