Commit Graph

315 Commits

Author SHA1 Message Date
Paul Sokolovsky 26fd0ac571 esp8266/Makefile: Be sure to pass cross-compiling AR when building axtls.
Fixes build under MacOSX.
2016-05-02 01:22:42 +03:00
Paul Sokolovsky 9dd2c92d01 esp8266/README: Mention WebREPL. 2016-04-30 23:02:54 +03:00
Paul Sokolovsky c1d1c562f3 esp8266/scripts/webrepl: Add "first connection" mode to setup password.
If there's no port_config.py file, or it lacks WEBREPL_PASS variable,
"initial setup mode" will be entered on first WebREPLconnection. User
will be asked for password, which will be written to
port_config.WEBREPL_PASS, and system restarted to work in normal mode
with password active.
2016-04-30 20:41:09 +03:00
Paul Sokolovsky 962d5a987f esp8266/scripts/webrepl: Switch to using _webrepl object wrapper.
Handling of binary protocol is untested on esp8266 so far.
2016-04-30 20:39:35 +03:00
Paul Sokolovsky 006ffe1561 esp8266/scripts/webrepl: Connection ack prompt is now printed by modwebrepl.
After password is checked.
2016-04-30 20:38:05 +03:00
Paul Sokolovsky 6ddd9f3e2b esp8266/scripts/inisetup: Create default boot.py in filesystem.
Currently it pre-imports webrepl, but doesn't start it.
2016-04-29 20:11:48 +03:00
Paul Sokolovsky 74f413bc60 esp8266/scripts/_boot: builtins is no longer used. 2016-04-29 20:04:17 +03:00
Paul Sokolovsky d86d65f625 esp8266/scripts: Move all of initial setup to inisetup module. 2016-04-29 20:02:59 +03:00
Paul Sokolovsky adae53d522 esp8266: Enable webrepl module. 2016-04-29 19:38:21 +03:00
Paul Sokolovsky f8170db390 esp8266: Enable WebREPL file transfer rate limiting. 2016-04-29 19:15:26 +03:00
Paul Sokolovsky 22050a3ed0 esp8266/help: Add cheatsheet for basic WiFi configuration. 2016-04-29 00:34:08 +03:00
Paul Sokolovsky b639ce27c7 esp8266/help: Implement help() builtin. 2016-04-29 00:17:11 +03:00
Aex Aey af554b4ba2 esp8266/modnetwork: Make WLAN.ifconfig() read/write.
Allow setting ip, netmask, gw and dns server (also, allows getting dns).
For docs see: https://github.com/micropython/micropython/commit/06deec9
2016-04-28 23:51:04 +03:00
bsdfox 193c62226c esp8266/README: Add recently required step of 'make axtls'. 2016-04-28 21:42:04 +03:00
Paul Sokolovsky 978a429aaa esp8266: Set suitable values for axtls's RT_MAX_PLAIN_LENGTH & RT_EXTRA. 2016-04-28 17:45:22 +03:00
Damien George 8c3b5526ae esp8266/scripts/neopixel.py: Remove test function from neopixel driver.
It takes up lots of room and isn't needed.
2016-04-28 13:37:17 +01:00
Damien George 1f7cec944e esp8266/scripts/onewire.py: Simplify and improve 1-wire driver.
Changes are:
- added OneWireError exception and used where errors can occur
- renamed read/write functions to use same names as C _onewire funcs
- read_bytes is now read, write_bytes is now write
- add ability to read/write DS18B20 scratch pad
- rename start_measure to convert_temp (since that's what it does)
- rename get_temp to read_temp (consistency with other read names)
- removed test function
2016-04-28 13:33:55 +01:00
Damien George 38358a096d esp8266: Move onewire.py, neopixel.py drivers from tests/ to scripts/. 2016-04-28 12:36:45 +01:00
Damien George a6aa35af09 esp8266: Move pyb.info() function to esp module and remove pyb module.
All functionality of the pyb module is available in other modules, like
time, machine and os.  The only outstanding function, info(), is
(temporarily) moved to the esp module and the pyb module is removed.
2016-04-28 12:23:55 +01:00
Paul Sokolovsky 0785040593 esp8266/Makefile: Enable "ussl" module.
axTLS should be built first using "make axtls".
2016-04-28 00:48:38 +03:00
Paul Sokolovsky 941ddfe559 esp8266/Makefile: Support linking with axTLS built from source. 2016-04-28 00:48:38 +03:00
Damien George 8ed3a9eb9c esp8266/tests/onewire.py: Don't run test on import. 2016-04-27 22:32:39 +01:00
Paul Sokolovsky dc2c8f0b1a esp8266/axtls_helpers: Helper/wrapper functions for axTLS. 2016-04-27 14:54:36 +03:00
Paul Sokolovsky 648333d2d5 esp8266/Makefile: Override abort() when building axtls.
abort() is a special function known to compiler as no-return.
2016-04-27 13:41:59 +03:00
Paul Sokolovsky 6afd651f1e esp8266/esp8266.ld: Put axTLS to FlashROM. 2016-04-27 00:45:09 +03:00
Paul Sokolovsky 6149ce01f8 esp8266/Makefile: Add target to build axTLS. 2016-04-27 00:35:13 +03:00
Paul Sokolovsky 90b2cfe644 esp8266/scripts/webrepl: Add "ws://" to "daemon started at" message.
To remind people it's not HTTP.
2016-04-26 12:47:24 +03:00
Paul Sokolovsky 237c519ac4 esp8266/scripts/flashbdev: Use all available Flash for filesystem.
All Flash sans firmware at the beginning and 16K SDK param block at the
end is used for filesystem (and that's calculated depending on the Flash
size).
2016-04-26 01:36:32 +03:00
Paul Sokolovsky ef2ffc0e4e esp8266/scripts/webrepl: Print client address for incoming connections. 2016-04-26 01:00:28 +03:00
Paul Sokolovsky c888831410 esp8266/scripts/webrepl: Print connection address.
Based on active network interfaces.
2016-04-26 00:59:30 +03:00
Paul Sokolovsky 6d103b6548 py: Move call_function_*_protected() functions to py/ for reuse.
They almost certainly needed by any C code which calls Python callbacks.
2016-04-25 19:31:17 +03:00
Paul Sokolovsky 4296a8dc5c esp8266/scripts/webrepl: Allow to override port. 2016-04-25 18:44:37 +03:00
Paul Sokolovsky bd66b09512 esp8266/scripts/webrepl: Don't start on import.
Explicit .start() is required now.
2016-04-25 00:33:27 +03:00
Paul Sokolovsky 8db4f363e9 esp8266/scripts/webrepl: Convert to persistent daemon. 2016-04-25 00:31:43 +03:00
Paul Sokolovsky 7c40b15a3f esp8266/scripts/webrepl: WebREPL based on C-level websocket object. 2016-04-24 23:04:21 +03:00
Paul Sokolovsky d422e56631 esp8266/scripts/websocket_helper: Disable debug output. 2016-04-22 18:19:54 +03:00
Paul Sokolovsky eb40769613 esp8266/scripts/websocket_helper: Module encapsulating handshake sequences. 2016-04-22 18:18:27 +03:00
Damien George b372156f74 esp8266: Change software SPI driver to use general pin HAL. 2016-04-22 10:44:06 +01:00
Damien George 67a6d31955 esp8266: Allow GPIO16 to be used as a pin in the uPy pin HAL.
Now I2C works with GPIO16 as the SCL or SDA pin.
2016-04-22 10:35:26 +01:00
Damien George a2d5d84ecc esp8266: Convert mp_hal_pin_obj_t from pin ptr to simple integer.
Most pin I/O can be done just knowing the pin number as a simple
integer, and it's more efficient this way (code size, speed) because it
doesn't require a memory lookup to get the pin id from the pin object.

If the full pin object is needed then it can be easily looked up in the
pin table.
2016-04-22 10:04:12 +01:00
Damien George 624738ca64 extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr. 2016-04-22 09:56:02 +01:00
Damien George d4f4cb6a24 esp8266/esp_mphal: Remove mp_hal_feed_watchdog.
It doesn't do anything and is not needed.  ets_loop_iter/ets_event_poll
now take care of feeding the WDT.
2016-04-21 15:30:29 +01:00
Damien George c4e26dd19a esp8266/uart: Remove obsolete UART rx buffering code.
It's now completely replaced by the ringbuf implementation.
2016-04-21 15:27:18 +01:00
Damien George d46bea9ffa esp8266: Implement UART.read functionality. 2016-04-21 15:19:19 +01:00
Damien George 7652ab77ef esp8266: Add uart_rx_wait and uart_rx_char functions. 2016-04-21 15:19:00 +01:00
Damien George 32d7cf6e44 esp8266: Implement basic deep-sleep capabilities.
Use the machine.deepsleep() function to enter the sleep mode.  Use the
RTC to configure the alarm to wake the device.

Basic use is the following:

    import machine

    # configure RTC's ALARM0 to wake device from deep sleep
    rtc = machine.RTC()
    rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)

    # do other things
    # ...

    # set ALARM0's alarm to wake after 10 seconds
    rtc.alarm(rtc.ALARM0, 10000)

    # enter deep-sleep state (system is reset upon waking)
    machine.deepsleep()

To detect if the system woke from a deep sleep use:

    if machine.reset_cause() == machine.DEEPSLEEP_RESET:
        print('woke from deep sleep')
2016-04-21 11:43:37 +01:00
Paul Sokolovsky 4fa1731b6e esp8266/modnetwork: .config(): Add "hidden ESSID" param. 2016-04-21 00:42:45 +03:00
Paul Sokolovsky cc1ef76f88 esp8266/scripts/flashbdev: Correct bootloader flash size to match real size.
Flash size as seen by vendor SDK doesn't depend on real size, but rather on
a particular value in firmware header, as put there by flash tool. That means
it's user responsibility to know what flash size a particular device has, and
specify correct parameters during flashing. That's not end user friendly
however, so we try to make it "flash and play" by detecting real size vs
from-header size mismatch, and correct the header accordingly.
2016-04-20 18:07:34 +03:00
Paul Sokolovsky 584406880c esp8266/scripts/_boot: Print notice when initial setup is executed. 2016-04-20 18:01:09 +03:00
Paul Sokolovsky 2494399a42 esp8266/scripts/flashbdev: Disable debug output/checks. 2016-04-20 00:35:46 +03:00