element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Hardware ESP32 and Mongoose OS - Discoveries
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mcb1
  • Date Created: 12 Jan 2018 7:06 AM Date Created
  • Views 897 views
  • Likes 7 likes
  • Comments 0 comments
  • esp32
  • mongoose os
  • build
  • github
  • build files
  • com_port
  • flash
  • git
  • wemos
  • lolin32
Related
Recommended

ESP32 and Mongoose OS - Discoveries

mcb1
mcb1
12 Jan 2018

I started diving into ESP32 and MongooseOS back here.

ESP32 and Mongoose OS - Intro

 

my first application attempt was realtively painless

ESP32 and Mongoose OS - First Application

 

It all seemed too easy until I struck some unexplained issues

ESP32 and Mongoose OS - Issues

 

 

Now that I have discovered the problem was with the application, I tried importing another temperature application.

image

I'm rather happy to report that this one worked flawlessly.

 

So I haven't broken any hardware, my drivers are fine, and it works as it should.

 

 

Other niggles

The OS is still a WIP (Work in Progress) as evidenced by the documentation showing a different layout than my version.

I'm not sure the error handling works as well as it could, but it is a free resource, and we can expect some issues.

 

What we need to understand is how to overcome these hurdles when we strike them.

 

I have managed to get the OS to not communicate with the device, and then get itself bitter and twisted.

image

The above message is typical if the device is unplugged, the device info shows it has no idea.

image

Simply click on the ComPort and then Select and Done.

you may also need to press the reset button on the device

 

However I have still witnessed some other weird messages with the comment about starting mos ui using the terminal.

Usually a refresh of the browser and reset of the device seems to sort these out, and if not an unplug and replug the USB seems to sort it.

 

Eventually I figure out what I'm doing wrong.

 

 

 

File System

I have struck an issue where an import won't work

It seemed to think there was a copy already, and no matter what I did, I could not import it.

 

The files are stored locally at

C:\Users\xxxxxxx\.mos\apps-1.23 (where xxxxxxxx represents your username)

 

Personally I do not like programs that don't allow you to decide where they reside.

If someone was using a small SSD boot drive, then it wouldn't take long for these type of Apps to fill it.

There might be some way of shifting it ... I just haven't found it yet.

 

Here there is 5 apps.

which nicely lines up with the OS imageimage

 

In the situation where it refused to Import, there was a directory in the .mos directory, that the OS didn't know about for whatever reason.

 

Deleting it, allowed the Import to work, but obviously any alterations you've made will be deleted.

I would recommend keeping a copy of your own somewhere else (see below on replacing it)

 

 

Opening up the directories will show that a build has taken place for example-arduino-onewire-c and Weather

image

So this means we can flash them to the Device without having to go through a build process.

BUT if you want to make changes to main.c or some library, then you'll need to rebuild the App.

 

I'm guessing this is common sense to anyone more used to this type of programming, but if like me you've come from Arduino where the build happens after you hit Upload, it will seem foreign.

 

 

Build Process

The documentation gives some insight into the process of a build.

https://mongoose-os.com/docs/book/build.html

The info under 'Build Process deep dive' gives how it works, but I think it could be better explained if this is going to be the next Arduino IDE.

 

I've removed all the extra bits to arrive at my view of the process :-

When the build command is executed, the following happens:

 

mos scans libs: section of the mos.yml file and imports all libraries into the libs directory.

Each library also has mos.yml file, and a library could have a libs: section as well, mos imports all dependent libraries too, recursively.

 

When all required libraries are imported, mos executes git pull in each of them, in order to  update. At this point, all required libraries are imported and updated.

 

mos combines app's mos.yml files together and the application's mos.yml has the highest  priority.

 

mos packs source and filesystem files and sends them to the Mongoose OS cloud build backend at http://mongoose.cloud, which performs an actual build, and sends back a build/ directory with built build/fw.zip and artifacts.

 

Generated artifacts in the build/ directory is as follows:

  • build/fw.zip  - a built firmware
  • build/fs      - a filesystem directory that is put in the firmware
  • build/gen     - a generated header and source files

 

 

New Apps

There is a bit of documentation reagrding new apps at

https://mongoose-os.com/docs/book/build.html

image

my version does not seperate and show my Libs, but rather it looks like this.

image

Clicking on New brings up a dialogue box.

image

 

While I did build the Weather app using this method, it will work for a build from scratch approach.

 

 

 

Importing

BUT if you're like me and found someone elses App on Github, I haven't found a great way to import that.

 

I did discover that you can download it, extract it, and drop it into the apps-1.23 directory.

Hit refresh on the MongooseOS browser and it will appear.

 

  and the OS gui shows  imageimage

 

You can also copy a directory, paste it into the apps-1.23 and refresh the gui.

   and after refresh the gui    imageimage

 

Personally this might be the better way to copy a blank App.

Set it up as you want, then save the files, and copy the directory ready to use each time.

 

 

Naming

You may have noticed that the name of the project appears along with the description.

This is in the mos.yml file

image

You can change it with your favourite editor, or with the gui, and then save.

The name is also part of the flash, as shown in my earlier work.

image

The example I used had mjs-latest as the name, which also shows in the title bar.

image

 

 

 

 

So hopefully that has filled in a few blanks.

I'm learning how to get this to work, or maybe it's teaching me, but either way the progress is less frustrating.

 

If only my java coding was heading in the same direction.

 

Mark

 

 

 

Previous

ESP32 and Mongoose OS - Intro

ESP32 and Mongoose OS - First Application

ESP32 and Mongoose OS - Issues

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube