cesanta / mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
https://mongoose-os.com
Other
2.49k stars 430 forks source link

Ubuntu Platform, part two. #476

Closed pimvanpelt closed 5 years ago

pimvanpelt commented 5 years ago

Part two of the Ubuntu platform.

The project is now able to compile mongoose and i2c lib.a correctly.

rm -rf build/
mos build --no-platform-check --local --verbose --platform ubuntu
sudo setcap "cap_sys_chroot,cap_net_bind_service+ep" build/bin/empty
build/bin/empty 

main                 PIDs: parent=15671 child=15672 uid=1000 gid=1000 euid=1000 egid=1000
ubuntu_cap_init      Setting chroot=/home/pim/src/empty/build/fs
ubuntu_cap_init      pid=15672 uid=1000 gid=1000 euid=1000 egid=1000
mongoose_init        Mongoose OS 201901241501 (20190124-150158/2.10.2-43-g038f7765-master)
mongoose_init        empty 1.0 (20190124-150158/2.10.0-dirty-master-g01d3f5b73)
mongoose_init        CPU: 1605 MHz, heap: 16799997952 total, 5432848384 free
mongoose_init        Network: ip=194.126.235.37 netmask=255.255.255.240 gateway=194.126.235.33
mgos_hw_timers_init  Not implemented yet
mgos_vfs_common_init Not implemented yet
mgos_core_fs_init    Not implemented yet
mgos_gpio_hal_init   Not implemented yet
mgos_sys_config_init MAC: 0002C94F0668
mgos_sys_config_init WDT: 30 seconds
mgos_deps_init       init i2c...
mgos_i2c_create      I2C init ok (dev: /dev/i2c-6, freq: 100000)
mgos_init            Init done, RAM: 16799997952 total, 5432848384 free, 0 min free
mgos_event_trigger   ev MOS0 triggered 0 handlers
app_cb               counter=1 uptime=1019778
i2cscan              Found device at I2C address 0x48
pimvanpelt commented 5 years ago

Perhaps hold off on review/merging this. There are still some issues with generating artifacts (like json0.conf and a complete config schema). Will ping once I made more progress.

pimvanpelt commented 5 years ago

Ready to merge. PTAL @rojer

pimvanpelt commented 5 years ago

5eb7cae needs a release of mgos/ubuntu-build:r2 as we're now linking in libcap, and I've made it a static executable for portabliity so users do not need to install libcap-dev Ubuntu package on their host.

rojer commented 5 years ago

integrating this now, thanks a lot!

rojer commented 5 years ago

https://github.com/cesanta/mongoose-os/commit/324ab2516a41196ac55d6ee15e39ac07374e7e66