Commit graph

246 commits

Author SHA1 Message Date
sheinz
6ff78f802d DHT11/DHT22 library fixes.
Fixed temperature below zero.
Fixed checksum overflow verification.
Fixed inconsistent reading of DHT11.
2016-07-06 21:01:44 +03:00
sheinz
a41407e3d1 DHT11/22 library fix
Support DHT11/DHT22 modules.
Data representation fix.
Library refactoring.
2016-07-06 15:58:59 +03:00
Angus Gratton
678b59babf Honour values of configCPU_CLOCK_HZ & configTICK_RATE_HZ for tick rate
Fixes #147

* Can vary tick rate from 100Hz via configTICK_RATE_HZ. Note that the
  SDK binary libraries are hard-coded to assume the tick rate is 100Hz,
  so changing the tick rate may have unexpected consequences for lower
  layer WiFi behaviour (such as certain kinds of timeouts happening
  faster/slower.)

* Setting configCPU_CLOCK_HZ to 160MHz means ESP will set 160MHz during
  initialisation. Only 80MHz and 160MHz are supported.

* Timing of tasks is no longer affected by current CPU freq (whether set
  via configCPU_CLOCK_HZ or via sdk_system_update_cpu_freq().)
  Previously doubling the CPU frequency would double the tick rate.
2016-07-06 17:22:09 +10:00
Alex Stewart
8c9a77efe8 Added first half of RE'd user_interface.c 2016-07-06 17:21:34 +10:00
sheinz
0f9d991ba7 Fixed libc and SPIFFS integration. Test passes on ESP-12E module. 2016-06-30 22:18:07 +03:00
sheinz
b71a7ad237 Use SPIFFS for POSIX file access. Draft. Not tested. 2016-06-30 17:38:05 +03:00
sheinz
ab795350fb Draft implementation of SPIFFS integration 2016-06-27 18:06:06 +03:00
Johan Kanflo
3c875cc418 Call DisconnectNetwork(...) before MQTT reconnect 2016-06-21 20:43:02 +02:00
Angus Gratton
4b39a0e6ca Merge pull request #136 from SuperHouse/feature/ota_improvements
OTA improvements, always enable OTA mode
2016-05-28 12:46:58 +10:00
Angus Gratton
230aa9fd37 Add new "RAM" storage macro for putting constant data in RAM
Also update comments in common_macros.h following #142
2016-05-28 12:39:56 +10:00
Angus Gratton
7fe2020785 ota_basic example: Update TFTP client calls 2016-05-28 11:27:10 +10:00
Angus Gratton
d62fd4899a ota_basic example cleanup 2016-05-28 11:27:10 +10:00
Angus Gratton
d9202af2aa Use latest upstream rboot, always build with OTA - use prebuilt rboot if
none is compiled locally.
2016-05-28 11:27:10 +10:00
Angus Gratton
53b2b50241 rboot: Add cryptographic digest support for OTA images & SHA256 example 2016-05-28 11:27:10 +10:00
Angus Gratton
03559de5cb Move rboot_verify_image to rboot-api
Removes rboot-integration.c, removes need for clients to include rboot-integration.h
2016-05-28 11:27:10 +10:00
Angus Gratton
e671927bd0 OTA: Add TFTP client mode, expand ota_basic example. 2016-05-28 11:27:10 +10:00
Angus Gratton
3ba19d7c4e Merge pull request #137 from SuperHouse/feature/better_crash_dumps
Better crash dumps
2016-05-17 09:38:19 +10:00
Drasko DRASKOVIC
e7607ffc2b Add JSON support
This commits adds JSON support by adding Jsmn
(http://zserge.com/jsmn.html), a minimalistic JSON parser.

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2016-05-15 22:32:14 +10:00
Angus Gratton
36886412e6 Add abort() implementation
Also reduces the IRAM footprint of the fatal exception handler, as only
the prelude (which disables interrupts & enables the flash mapping) is
in IRAM now.

Closes #54, relevant to #133.
2016-05-15 22:30:01 +10:00
Angus Gratton
5809a0119b Merge pull request #114 from doragasu/sntp
Added sntp support and example
2016-05-15 20:42:35 +10:00
jsuiker
99eba80c4d Added DHT library to extras and sample code to examples 2016-04-25 01:58:09 +00:00
Angus Gratton
2badeed523 cpp_01_tasks example: Remove spurious OTA=1 (ref #128) 2016-04-20 09:25:40 +10:00
Angus Gratton
1c998a3edf http_get_mbedtls example: Update for howsmyssl.com server-side changes
New letsencrypt CA cert since they left beta, and HTTP server now
expects a Host header.
2016-04-20 09:25:40 +10:00
Angus Gratton
736e790e80 Merge pull request #124 from kanflo/rboot-merge
Updated rboot to #75ca33b including the flash write bug.
2016-04-15 11:19:56 +10:00
Yudi Ludkevich
7e9d5bd2e2 MQTT client api and example
This code based on ESP8266 port of the embedded C client in Eclipse Paho project
(http://www.eclipse.org/paho/) and it port for espressif
ESP8266_RTOS_SDK by baoshi (https://github.com/baoshi/ESP-RTOS-Paho.git)
2016-04-14 16:59:07 +10:00
Johan Kanflo
9c49134d61 Updated rboot to #75ca33b including the flash write bug. 2016-04-07 20:29:28 +02:00
Alex Stewart
494c2d9cec Implement new ds18b20 APIs 2016-04-05 10:05:42 -07:00
Alex Stewart
a2b9d688ea Multiple cleanups/tweaks for onewire driver
Use onewire_addr_t for onewire addresses
Move internal defines out of onewire.h
Remove global variables for search state
use taskENTER_CRITICAL instead of portDISABLE_INTERRUPTS
remove unnecessary onewire_init function
Remove unnecessary critical sections
Use GPIO_OUT_OPEN_DRAIN
reformat/style cleanup
2016-04-05 10:03:17 -07:00
doragasu
11c9031d9b Removed my _time() implementation to use newlib provided one. 2016-03-31 16:05:15 +02:00
doragasu
f4a5675854 Merge branch 'master' of https://github.com/SuperHouse/esp-open-rtos into sntp 2016-03-31 15:41:20 +02:00
doragasu
9651692ca2 Cleanup and some changes to make implementation a bit more conforming to the standard. 2016-03-13 18:29:30 +01:00
doragasu
f14025b1c7 Removed non working clock_* calls from example. Using vars for tz and dst. 2016-03-13 17:04:03 +01:00
doragasu
0482aebf7d Added quick and dirty _gettimeofday_r() test implementation. 2016-03-11 13:11:15 +01:00
doragasu
16c831fffa Added sntp support and example 2016-03-09 17:18:51 +01:00
Kazuyoshi Kato
41e28717f9 howmyssl.com's root certificate has been updated
Now the site is using Let's Encrypt's root certificate.
2016-03-08 20:19:50 -08:00
Ondřej Hruška
b0e683b909 Use anonymous struct in ws2812_rgb_t. 2016-03-01 23:17:13 +01:00
Ondřej Hruška
e97dca4859 Added WS2812 driver and examples (squashed commits) 2016-03-01 14:06:40 +01:00
Grzegorz Hetman
02751c820d Add short comment and license info. 2016-02-24 17:19:33 +01:00
Grzegorz Hetman
b5f1c893bf Merge branch 'master' into ds18b20 2016-02-24 17:05:20 +01:00
Alex Stewart
d0ed5f03a2 A couple of fixups prior to merging into main project
Changed the ds_sensor_t struct to just return a float instead of major/minor
Renamed ds18b20.h functions to have consistent `ds18b20_*` naming.
Removed some unnecessary LICENSE files.  Clarified onewire origin/license.
2016-02-22 21:18:50 -08:00
Angus Gratton
7c1d7fb43e Merge branch 'feature/dhcp-server' 2016-02-21 10:36:28 +11:00
Grzegorz Hetman
6178865cc6 Add clear version of commit 72f30ad. 2016-02-18 18:42:50 +01:00
Angus Gratton
30d8e162b3 blink example: Change default to GPIO2 as this pin has an LED on most boards 2016-02-09 10:58:56 +11:00
Angus Gratton
3dfa2272cc mbedtls: mbedlts_net_bind should bind on all interfaces with bind_ip == NULL
As per mbedtls documentation. This is different to lwip_getaddrinfo()
which uses loopback for a NULL address.

Fixes bug mentioned here https://groups.google.com/forum/#!topic/esp-open-rtos/3KH5TZSTMUw
2016-02-09 10:54:57 +11:00
Angus Gratton
e2759f9e7d Merge pull request #77 from jcard0na/master
Initial PWM implementation from gpascualg
2016-02-09 09:30:51 +11:00
Angus Gratton
d5e50edc0b ota_basic example, ota-tftp support: Add links to the new OTA wiki page 2016-02-08 16:58:31 +11:00
Angus Gratton
c8716747bb Add tls_server example, showing binding a socket and accepting a TLS connection 2016-02-08 15:41:44 +11:00
Blipi
72d5dd99fb Initial PWM implementation from gpascualg 2015-12-11 15:20:28 -08:00
Angus Gratton
812c2fef21 Removed INLINED (force inline) macro.
Progress towards #57.
2015-11-28 18:01:03 +11:00
Angus Gratton
336bad573d timers.h: Remove compile-time-auto-inlining complexity
Fixes bug mentioned in #72 (oops!), also progress towards #57.
2015-11-28 16:32:52 +11:00
Angus Gratton
01773fd1c9 terminal example: Remove unused BUFFER_SIZE macro, redundant setbuf
(Line-buffering is now disabled by default.)

Relates to #59.
2015-11-21 17:11:41 +11:00
Johan Kanflo
4cfe40d348 extras/stdin_uart_interrupt: stdin via IRQ driven RX driver on UART0
See examples/terminal/ for usage
2015-11-21 16:15:58 +11:00
Angus Gratton
6506a29d21 serial_echo example: Remove setbuf() call as stdout no longer buffered by default 2015-10-27 13:36:51 +11:00
Angus Gratton
a5a76ed93d http_get_mbedtls example: Remove fflush() calls as stdout is no longer line buffered 2015-10-11 09:25:51 +11:00
Angus Gratton
7823a28ff8 Change default baud rate back to 74906bps, compatible with boot ROM rate
This reverts a behaviour change from 3ceadfc0a6.
2015-10-06 23:11:17 +11:00
Angus Gratton
4f05f15366 serial_echo: Fix program name in makefile 2015-10-06 17:55:37 +11:00
Angus Gratton
3060d72234 Add a basic serial_echo example, with a silly Easter Egg 2015-10-06 17:54:43 +11:00
Angus Gratton
3ceadfc0a6 uart.h: Add uart_get_baud/uart_set_baud functions, change default baud rate from 74906 to 115200 2015-10-06 17:49:00 +11:00
Angus Gratton
233e5f377a Remove axTLS 2015-09-28 13:01:22 +10:00
Angus Gratton
99facb808e hmac_test_vectors test: Replace axTLS with mbedTLS 2015-09-28 13:01:22 +10:00
Angus Gratton
fc9d9ff89c Merge branch 'experiments/unaligned_load' into feature/mbedtls_notworking 2015-09-25 16:57:49 +10:00
Angus Gratton
4dd8712526 unaligned_load: Run some tests after scheduler/network/wifi all up and running
As written this doesn't expose any new bugs.
2015-09-25 09:41:53 +10:00
Angus Gratton
edbfd3a66e unaligned_load tests: Remove incorrect references to DoubleException 2015-09-25 09:22:06 +10:00
Angus Gratton
43a8bf2087 Merge branch 'master' into feature/dhcp-server 2015-09-24 08:33:48 +10:00
Angus Gratton
59a0a6f86e http_get_mbedtls: Add root cert used by howmyssl.com 2015-09-20 21:41:39 +10:00
Angus Gratton
8a470e6f98 Merge branch 'master' into feature/mbedtls 2015-09-20 21:26:29 +10:00
Angus Gratton
1b22cc088e Add initial mbedTLS and HTTPS example project (using howsmyssl.com JSON API)
mbedTLS version 2.1.0 (current stable)

Has some known issues/hacks:
* Entropy source not hooked in at all
* Linker script has a messy hack in it to store some (not all) data in
  irom
2015-09-20 21:13:38 +10:00
Angus Gratton
0da6c97a9d Rename main.cpp in tasks example 2015-09-20 21:13:38 +10:00
Angus Gratton
8a29e46319 examples/Makefile: Use MAKE to properly invoke make recursively 2015-09-20 21:13:38 +10:00
Angus Gratton
1c8017484c Move c++ operators back to link-time resolutions, part of 'core'
This reverts commit e9b1df5cb5.
2015-09-20 21:13:38 +10:00
Angus Gratton
6416fe7329 Post-merge cleanup of extras/cpp_support 2015-09-20 21:13:38 +10:00
Michael Jacobsen
fbb01c81ad Header files adjustment
(MQTT changes split from original commit - @projectgus.)
2015-09-20 21:13:38 +10:00
Michael Jacobsen
602d3e2d98 Header files re-arrangement 2015-09-20 21:13:38 +10:00
Michael Jacobsen
028451fa84 Updated license 2015-09-20 21:13:38 +10:00
Michael Jacobsen
627b78331a Added C++ base components and example 2015-09-20 21:13:38 +10:00
Angus Gratton
94fabc6ceb Add basic C++ new/delete operators, as contributed by @mikejac in #24 2015-09-20 21:13:38 +10:00
Angus Gratton
cc97067fa1 Add C++ support to Makefile, and proof-of-concept simple.cpp example
This is a work in progress based on @mikejac's work.

Missing:
* No 'new' operator.
* I don't think STL is currently supported.
2015-09-20 21:13:38 +10:00
Alex Stewart
a3d7732da8 unaligned_load.c: Added more naive_strcpy tests
Added tests for naive_strcpy using a variety of different regs, as execution time can depend on which register is being used.
2015-09-19 20:03:22 -07:00
Alex Stewart
4c89a0574b Add sanity-test suite to unaligned_load.c
Tests are designed to methodically exercise all code paths/opcodes/offsets/etc.
2015-09-19 15:16:44 -07:00
Angus Gratton
cceb9de300 bmp180 i2c: Fix typo temperatue->temperature.
Closes #47
2015-09-18 17:59:50 +10:00
Angus Gratton
7d779389ab unaligned_load: Fix sign extension, add test case for sign extension
H/T to @foogod again for this.
2015-09-15 12:00:32 +10:00
Angus Gratton
7ebebf6d22 unaligned_load: Add doubleexceptionvector behaviour test 2015-09-15 12:00:26 +10:00
Angus Gratton
0432ae3745 Use GPIO2 for led_debug.S 2015-09-14 17:20:00 +10:00
Angus Gratton
46111bad52 dhcpserver cleanup, add access_point example
DHCP Server & AP mode tested w/ Debian & Android clients
2015-09-13 18:42:20 +10:00
Angus Gratton
347f9d3a85 Rename main.cpp in tasks example 2015-09-12 16:28:11 +10:00
Angus Gratton
8b90dbd9e5 Merge branch 'feature/c++' 2015-09-12 16:27:26 +10:00
Angus Gratton
1aaef737df Fix printf format string changed in merge 2015-09-10 21:11:52 +10:00
Angus Gratton
ac0a947453 Merge branch 'master' into experiments/unaligned_load 2015-09-10 08:19:42 +10:00
Angus Gratton
7ed064a750 libc: Redefine int32_t/uint32_t as 'int' not 'long'
libc built from projectgus/newlib-xtensa@0077776963

Closes #42
2015-09-05 13:37:00 +10:00
Angus71
fd1081a0cc Added BMP180 and I2C driver and example
Fixed reference to unknown environment var
Moved drivers into extras folder and added additional documentations.
Changed LOCAL to static and renamed DEBUG to BMP180_DEBUG
2015-08-31 13:39:27 +02:00
Angus Gratton
778b94cf40 examples/Makefile: Use MAKE to properly invoke make recursively 2015-08-26 11:14:34 +10:00
Angus Gratton
43ecec5470 Move c++ operators back to link-time resolutions, part of 'core'
This reverts commit e9b1df5cb5.
2015-08-26 11:07:06 +10:00
Angus Gratton
fff17627d9 Merge branch 'master' into feature/c++ 2015-08-26 10:46:48 +10:00
Angus Gratton
e9b1df5cb5 Post-merge cleanup of extras/cpp_support 2015-08-26 10:45:21 +10:00
Michael Jacobsen
5c1ce0a508 Header files adjustment
(MQTT changes split from original commit - @projectgus.)
2015-08-26 10:45:21 +10:00
Michael Jacobsen
94a953d3e3 Header files re-arrangement 2015-08-26 10:45:21 +10:00
Michael Jacobsen
6bc95994b7 Updated license 2015-08-26 10:45:21 +10:00
Michael Jacobsen
1282e11c08 Added C++ base components and example 2015-08-26 10:45:21 +10:00
Angus Gratton
aa17221929 Merge pull request #27 from foogod/issue_8
Convert headers to new *_regs.h format
2015-08-22 17:36:37 +10:00
Angus Gratton
66a1983a95 examples/Makefile: Make more make-like instead of using shell loops
Shell loops broke Travis fairly severely.
2015-08-21 15:54:01 +10:00
Alex Stewart
ab6f4b8420 Fixup some constants used in examples 2015-08-20 15:11:29 -07:00
Alex Stewart
fc1a1a7d0a Add esp/gpio_regs.h 2015-08-18 22:46:25 -07:00
Alex Stewart
2ffd3da71e Add esp/iomux_regs.h 2015-08-18 17:38:31 -07:00
Angus Gratton
7d480876fa Add basic C++ new/delete operators, as contributed by @mikejac in #24 2015-08-13 08:33:07 +10:00
Angus Gratton
8ea4ae27e2 Unaligned loader: Support l16si 2015-08-11 15:03:53 +10:00
Angus Gratton
424dc0f3b0 Add C++ support to Makefile, and proof-of-concept simple.cpp example
This is a work in progress based on @mikejac's work.

Missing:
* No 'new' operator.
* I don't think STL is currently supported.
2015-08-10 16:14:30 +10:00
Angus Gratton
3eee1a9845 Examples: Fix printf argument flags for older example programs 2015-08-10 14:50:56 +10:00
Angus Gratton
72670be012 Update work with WiFi credentials
PR #16
2015-08-10 14:50:32 +10:00
Angus Gratton
bfd38cd1e2 Experimental support for storing const strings in SPI flash or IRAM
As discussed in #11

Known limitations:
- Only supports l8ui/l16ui
- Unoptimised load routine
- Not called from DoubleExceptionHandler but should be
- Doesn't restore state properly when falling through to fatal exception handler
2015-08-10 12:03:03 +10:00
Johan Kanflo
0e521a74a9 WiFi credentials
Changed local.h to include/ssid_config.h and added instructions on how
to keep your WiFi credentials safe from Github.
2015-08-07 13:26:06 +02:00
Angus Gratton
19b8383069 Working TFTP server based OTA updates
Tested with 16MBit flash configuration, two rboot update slots.

Closes #10
2015-08-05 14:10:14 +10:00
Angus Gratton
6887a8119a Simple example: Fix printf modifier 2015-08-05 14:04:12 +10:00
Angus Gratton
147257efa4 Almost functional OTA support
ota_basic example can receive new image via TCP.

However - writing to flash with interrupts disabled causes data loss,
and the TCP flow is very slow to recover. Linux sender quickly ramps up
RTT timer to very long retry intervals, crippling performance &
throughput.

Running the update without the flash writes causes the data to be
received quickly, so this is definitely an issue with the time taken for
the erase cycle.

Progress towards #10
2015-07-29 16:50:23 +10:00
Angus Gratton
86188c01fd Merge branch 'newlib' 2015-07-15 16:01:18 +10:00
Angus Gratton
1d72ed3f70 Hardware timer support 2015-07-09 12:29:40 +10:00
Angus Gratton
ad37abda8b blink examplpe: Fix FreeRTOSConfig mistake 2015-06-17 08:07:26 +10:00
Angus Gratton
72b61b17f8 Create a default FreeRTOSConfig.h, can override on a per-program basis
Closes #12
2015-06-16 17:28:32 +10:00
Angus Gratton
8478dfd92f Examples: Rename main.c files to more descriptive file names 2015-06-16 16:59:32 +10:00
Angus Gratton
f0db6f2b98 WiFi Examples: Load SSID & password from a common local.h file instead
of coding into program
2015-06-16 16:58:27 +10:00
Angus Gratton
2e51f7b164 http_get_ssl example: Fix name of output elf file 2015-06-16 14:23:48 +10:00
Angus Gratton
aaef4b0644 Replace all binary SDK libc functions with newlib
Adds a new build step to remove the SDK object files listed in
<libname>.remove.

Closes #1.
2015-06-16 14:21:24 +10:00
Angus Gratton
1b0124cf05 Timer FRC1 & FRC2 registers
Mostly determined from reverse engineering and poking around.

Includes first "experiments" program with random bits and pieces for
poking at registers, may be useful to keep in source control but not
useful for writing actual programs.
2015-06-12 17:05:54 +10:00
Angus Gratton
685a48583a Change 'TARGET' in makefiles to 'PROGRAM', keep consistent with documentation terminology 2015-06-12 10:26:02 +10:00
Angus Gratton
47a7bb1952 blink example: Remove stray gpio_enable call 2015-06-12 09:57:32 +10:00
Angus Gratton
6a5866aa55 http examples: don't write NULs to sockets
Thanks @pfalcon for the heads-up.
2015-06-09 09:03:56 +10:00
Angus Gratton
c09167715e Indentation fixes
- Fix dir-locals so emacs won't inject occasional tabs to case statements.
- Fix stray tab indentation in example programs. (Thx @pfalcon for pointing this out)
2015-06-09 09:00:32 +10:00
Angus Gratton
0078252df3 Add GPIO config, interrupt registers, GPIO interrupt support, 'button' example 2015-06-08 18:20:29 +10:00
Angus Gratton
2c46be9825 Basic support for GPIOs 0-15.
Start new 'core' component for low-level parts

Progress towards #8
2015-06-08 12:09:34 +10:00
Angus Gratton
81afe58334 Change symbol extraction to use objdump not nm
nm outputs warnings to stderr so hard to clean output.

Also now picks up global variables, like NMIIrqOn.
2015-06-02 17:57:33 +10:00
Angus Gratton
9e3328abe8 Add 'examples' top level Makefile for building all examples together 2015-06-02 17:56:41 +10:00
Angus Gratton
70cec6c3b7 Rename the sdk_prototypes header to sdk_private 2015-06-02 17:15:00 +10:00
Angus Gratton
1292829a07 Add hmac test vector test program 2015-06-02 17:15:00 +10:00
Angus Gratton
c126fa6430 Add README, 'make help', header comments, Copyright notices 2015-06-02 17:12:20 +10:00
Angus Gratton
93c3e1a53a Add http_get_ssl example 2015-06-02 17:12:20 +10:00
Angus Gratton
e743d03a78 Preprocess all binary SDK symbols to add an sdk_ prefix
* This fixes the problem of axTLS symbols hmac_md5/hmac_sha1 having same
  name as symbols in libwpa (which have incompatible signatures)

* Also allows for easier identification and piece-by-piece removal of
  binary functions.

* Some libc symbols are not renamed, list is in lib/symbols_norename.txt
2015-06-02 15:08:35 +10:00
Angus Gratton
a6e8647114 Clean up FreeRTOSConfig defaults, increase min task stack size 2015-06-02 15:08:35 +10:00
Angus Gratton
cba882b46d http_get example: Fix printing of DNS resolved IP 2015-06-02 15:08:35 +10:00
Angus Gratton
7c982da48f Add function prototypes for LWIP SDK functions, allow compilng with -Werror again 2015-06-02 15:08:35 +10:00
Angus Gratton
df9e9bf9a4 Working from-source IP stack 2015-06-02 15:08:35 +10:00
Angus Gratton
e4bc8fab7a First set of changes for from-source esp-lwip 2015-06-02 15:08:35 +10:00
Angus Gratton
806962d5c7 Replace lwip SDK blob with lwip 1.4.1 upstream source
Compiles but won't work yet
2015-06-02 15:08:26 +10:00
Angus Gratton
d68970d51b Add example HTTP client 2015-06-02 15:07:54 +10:00
Angus Gratton
c2bdc4bf96 Change main Makefile to common.mk, add per-example Makefile that
includes common.mk
2015-05-07 15:58:01 +10:00
Angus Gratton
a63d6b61c9 Make example slightly more complex 2015-05-07 14:23:24 +10:00
Angus Gratton
b3c674d89d Swap memory management to FreeRTOS-style, fixed heap size 2015-05-07 14:23:24 +10:00
Angus Gratton
1ffbc303ff Working variant of esp_iot_rtos_sdk (files from commit ec75c85f9ef53) 2015-05-07 14:22:25 +10:00