Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ethersex/ethersex
base: master
...
head fork: andreas23/ethersex
compare: master
Checking mergeability… Don’t worry, you can still create the pull request.
  • 11 commits
  • 18 files changed
  • 0 commit comments
  • 1 contributor
View
3  Makefile
@@ -97,6 +97,7 @@ SUBDIRS += services/stella
SUBDIRS += services/tftp
SUBDIRS += services/upnp
SUBDIRS += services/appsample
+SUBDIRS += services/brewtronic
SUBDIRS += services/watchcat
SUBDIRS += services/vnc
SUBDIRS += services/watchasync
@@ -188,7 +189,7 @@ OBJECTS += $(patsubst %.c,%.o,${SRC} ${y_SRC} meta.c)
OBJECTS += $(patsubst %.S,%.o,${ASRC} ${y_ASRC})
$(TARGET): $(OBJECTS)
- $(CC) $(LDFLAGS) -o $@ $(OBJECTS) -lc -lm # Pixie Dust!!! (Bug in avr-binutils)
+ $(CC) $(LDFLAGS) -o $@ $(OBJECTS)
SIZEFUNCARG ?= -e printf -e scanf -e divmod
size-check: $(OBJECTS) ethersex
View
1  config.in
@@ -411,6 +411,7 @@ mainmenu_option next_comment
comment "Applications"
source services/appsample/config.in
+source services/brewtronic/config.in
source services/bulbdial/config.in
source services/clock/config.in
source services/cron/config.in
View
5 core/eeprom.c
@@ -136,6 +136,11 @@ eeprom_init (void)
#ifdef MOTD_SUPPORT
eeprom_save_P(motd_text, PSTR(CONF_MOTD_DEFAULT), MOTD_VALUESIZE);
#endif
+
+#ifdef BREWTRONIC_SUPPORT
+ // TODO: implement reasonable EEPROM init code
+#endif
+
eeprom_update_chksum();
}
View
11 core/eeprom.h
@@ -49,6 +49,10 @@
#include "services/motd/motd.h"
#endif
+#ifdef BREWTRONIC_SUPPORT
+#include "services/brewtronic/brewtronic.h"
+#endif
+
struct eeprom_config_t {
#ifdef ETHERNET_SUPPORT
uint8_t mac[6];
@@ -104,6 +108,13 @@ struct eeprom_config_t {
char motd_text[MOTD_VALUESIZE];
#endif
+// TODO: change size constant names to match overal naming scheme
+#ifdef BREWTRONIC_SUPPORT
+ uint8_t rast_temp_ee[MAX_BREW];
+ uint8_t rast_zeit_ee[MAX_BREW];
+ uint8_t t_hist_ee[MAX_HIST];
+#endif
+
uint8_t crc;
};
View
12 hardware/onewire/onewire.c
@@ -166,7 +166,7 @@ uint8_t noinline ow_read_byte(uint8_t busmask)
int8_t noinline ow_read_rom(struct ow_rom_code_t *rom)
{
-#if ONRWIRE_BUSCOUNT > 1
+#if ONEWIRE_BUSCOUNT > 1
uint8_t busmask = 1 << (ONEWIRE_STARTPIN); // FIXME: currently only on 1st bus
#else
uint8_t busmask = ONEWIRE_BUSMASK;
@@ -411,8 +411,8 @@ int8_t ow_temp_read_scratchpad(struct ow_rom_code_t *rom, struct ow_temp_scratch
/* transmit command byte */
ow_write_byte(ONEWIRE_BUSMASK, OW_FUNC_READ_SP);
-#if ONRWIRE_BUSCOUNT > 1
- for (uint8_t bus = 0; bus < ONRWIRE_BUSCOUNT; bus++) {
+#if ONEWIRE_BUSCOUNT > 1
+ for (uint8_t bus = 0; bus < ONEWIRE_BUSCOUNT; bus++) {
/* read 9 bytes from each onewire bus */
busmask = (uint8_t)(1 << (bus + ONEWIRE_STARTPIN));
#else
@@ -427,7 +427,7 @@ int8_t ow_temp_read_scratchpad(struct ow_rom_code_t *rom, struct ow_temp_scratch
/* return if we got a valid response from one device */
return 1;
}
-#if ONRWIRE_BUSCOUNT > 1
+#if ONEWIRE_BUSCOUNT > 1
}
#endif
@@ -438,7 +438,7 @@ int8_t ow_temp_read_scratchpad(struct ow_rom_code_t *rom, struct ow_temp_scratch
int8_t ow_temp_power(struct ow_rom_code_t *rom)
{
-#if ONRWIRE_BUSCOUNT > 1
+#if ONEWIRE_BUSCOUNT > 1
uint8_t busmask = 1 << (ONEWIRE_STARTPIN); // FIXME: currently only on 1st bus
#else
uint8_t busmask = ONEWIRE_BUSMASK;
@@ -497,7 +497,7 @@ int8_t ow_eeprom(struct ow_rom_code_t *rom)
int8_t ow_eeprom_read(struct ow_rom_code_t *rom, void *data)
{
-#if ONRWIRE_BUSCOUNT > 1
+#if ONEWIRE_BUSCOUNT > 1
uint8_t busmask = 1 << (ONEWIRE_STARTPIN); // FIXME: currently only on 1st bus
#else
uint8_t busmask = ONEWIRE_BUSMASK;
View
730 scripts/profiles/brewtronic
@@ -0,0 +1,730 @@
+#
+# Automatically generated by make menuconfig: don't edit
+#
+
+#
+# General Setup
+#
+CONFIG_EXPERIMENTAL=y
+ARCH=ARCH_AVR
+ARCH_AVR=y
+# ARCH_HOST is not set
+# atmega8 is not set
+# atmega88 is not set
+# atmega128 is not set
+# atmega16 is not set
+# atmega162 is not set
+# atmega168 is not set
+# atmega168p is not set
+# atmega169 is not set
+# atmega32 is not set
+# atmega328p is not set
+# atmega64 is not set
+# atmega644 is not set
+MCU=atmega644p
+atmega644p=y
+# atmega1284p is not set
+FREQ=16000000
+# Arduino_Duemilanove is not set
+# conrad_probot is not set
+# ehaserl is not set
+# etherrape is not set
+# Fimser is not set
+# generic_usb_teensy is not set
+# hr20 is not set
+# Jackalope is not set
+# JeeLinkv2 is not set
+# MicroWebServer is not set
+HARDWARE=netio
+netio=y
+# other is not set
+# pollin_funkevalboard is not set
+# radig_web is not set
+# thermy is not set
+# CPU_SLEEP is not set
+# SRAM_SUPPORT is not set
+# SRAM_MEMTEST_ON_BOOT is not set
+# BOOTLOADER_SUPPORT is not set
+# TEENSY_SUPPORT is not set
+# SPI_TIMEOUT is not set
+# USART_SPI_SUPPORT is not set
+# SOFT_SPI_SUPPORT is not set
+# USE_GIT_VERSION is not set
+VERSION_STRING_CHOICE=USE_RELEASE_VERSION
+USE_RELEASE_VERSION=y
+# USE_BUILDDATE_VERSION is not set
+# DEBUG_DISCARD_SOME is not set
+# DEBUG is not set
+DEBUG_BAUDRATE=115200
+# DEBUG_USE_SYSLOG is not set
+# SOFT_UART_SUPPORT is not set
+# DEBUG_HOOK is not set
+# DEBUG_RESET_REASON is not set
+# STATUSLEDS is not set
+# STATUSLED_POWER_SUPPORT is not set
+# STATUSLED_BOOTED_SUPPORT is not set
+# STATUSLED_NETLINK_SUPPORT is not set
+# STATUSLED_TX_SUPPORT is not set
+# RFM12_TX_PIN is not set
+# ZBUS_TX_PIN is not set
+# STATUSLED_RX_SUPPORT is not set
+# RFM12_RX_PIN is not set
+# ZBUS_RX_PIN is not set
+# STATUSLED_HB_ACT_SUPPORT is not set
+# STATUSLED_HEARTBEAT_SUPPORT is not set
+# STATUSLED_RFM12_TX_ACT_SUPPORT is not set
+# STATUSLED_RFM12_RX_ACT_SUPPORT is not set
+# STATUSLED_ZBUS_TX_ACT_SUPPORT is not set
+# STATUSLED_ZBUS_RX_ACT_SUPPORT is not set
+# STATUSLED_ECMD_ACT_SUPPORT is not set
+# CRYPTO_SUPPORT is not set
+# CAST5_SUPPORT is not set
+# MD5_SUPPORT is not set
+# SHA1_SUPPORT is not set
+VFS_SUPPORT=y
+# VFS_DF_SUPPORT is not set
+VFS_INLINE_SUPPORT=y
+CONFIG_INLINE_SUPPORT=y
+VFS_CONFIG_INLINE_SUPPORT=y
+# MOTD_INLINE_SUPPORT is not set
+# RFM12_INLINE_SUPPORT is not set
+# I2C_INLINE_SUPPORT is not set
+VFS_IO_INLINE_SUPPORT=y
+# KTY_INLINE_SUPPORT is not set
+# ADC_INLINE_SUPPORT is not set
+ONEWIRE_INLINE_SUPPORT=y
+# CAMERA_INLINE_SUPPORT is not set
+# NAMED_PIN_INLINE_SUPPORT is not set
+# STELLA_INLINE_SUPPORT is not set
+# MOTORCURTAIN_INLINE_SUPPORT is not set
+# MSR1_INLINE_SUPPORT is not set
+# TO1_INLINE_SUPPORT is not set
+# MCUF_INLINE_SUPPORT is not set
+# GAME_INPUT_INLINE_SUPPORT is not set
+# UPNP_INLINE_SUPPORT is not set
+# LCD_INLINE_SUPPORT is not set
+# NMEA_INLINE_SUPPORT is not set
+# PWM_SERVO_INLINE_SUPPORT is not set
+# CW_INLINE_SUPPORT is not set
+VFS_INLINE_SVG_SUPPORT=y
+VFS_INLINE_HTML_CLEAN_SUPPORT=y
+# VFS_INLINE_OBSOLETE_BROWSER_SUPPORT is not set
+# DEBUG_INLINE_DUMMY is not set
+# DEBUG_INLINE_GZ is not set
+# DEBUG_INLINE_DISABLE_GZ is not set
+VFS_INLINE_INLINESVG_SUPPORT=y
+# VFS_HOST_SUPPORT is not set
+# VFS_SD_SUPPORT is not set
+# SD_READER_SUPPORT is not set
+# SD_READ_TIMEOUT is not set
+# SD_PING_READ is not set
+# VFS_EEPROM_SUPPORT is not set
+# VFS_EEPROM_RAW_SUPPORT is not set
+# VFS_DC3840_SUPPORT is not set
+# DATAFLASH_SUPPORT is not set
+# DEBUG_FS is not set
+# DEBUG_FS_INODETABLE is not set
+# DEBUG_FS_MARK is not set
+# VFS_EEPROM_DEBUG_SUPPORT is not set
+# DEBUG_SD_READER is not set
+# PAM_SUPPORT is not set
+# CONTROL6_SUPPORT is not set
+
+#
+# Network
+#
+CONF_HOSTNAME="RKCONTROL"
+ENC28J60_SUPPORT=y
+CONF_ENC_MAC="00:22:f9:01:0c:65"
+# IPV6_STATIC_SUPPORT is not set
+CONF_ENC_IP="192.168.115.99"
+CONF_ENC_IP4_NETMASK="255.255.255.0"
+# IEEE8021Q_SUPPORT is not set
+# DEBUG_ENC28J60 is not set
+# DEBUG_INTERRUPT is not set
+# DEBUG_REV4_WORKAROUND is not set
+ETHERNET_SUPPORT=y
+# TAP_SUPPORT is not set
+CONF_TAP_MAC="ac:de:48:fd:0f:d0"
+# IPV6_STATIC_SUPPORT is not set
+CONF_TAP_IP="192.168.23.244"
+CONF_TAP_IP4_NETMASK="255.255.255.0"
+CONF_TAP_LOCALIP="192.168.23.1"
+# IEEE8021Q_SUPPORT is not set
+# RFM12_IP_SUPPORT is not set
+CONF_RFM12_FREQ=RFM12_FREQ_433920
+RFM12_FREQ_433920=y
+# RFM12_FREQ_869775 is not set
+# RFM12_FREQ_869800 is not set
+# RFM12_FREQ_869825 is not set
+# RFM12_FREQ_869850 is not set
+# RFM12_FREQ_869875 is not set
+# RFM12_FREQ_869900 is not set
+# RFM12_FREQ_869925 is not set
+# CONF_RFM12_SLOW_SPI is not set
+# CONF_RFM12B_SUPPORT is not set
+CONF_RFM12_BAUD=19200
+CONF_RFM12_IP="192.168.5.1"
+CONF_RFM12_IP4_NETMASK="255.255.255.0"
+# RFM12_SOURCE_ROUTE_ALL is not set
+# RFM12_PCKT_FWD is not set
+# RFM12_ARP_PROXY is not set
+# RFM12_DISABLE is not set
+# RFM12_RAW_SUPPORT is not set
+# USB_SUPPORT is not set
+# USB_KEYBOARD_SUPPORT is not set
+# USB_HID_KEYBOARD_SEQUENCE_SUPPORT is not set
+# USB_HID_KEYBOARD_STATIC_SUPPORT is not set
+# USB_HID_KEYBOARD_ECMD_SUPPORT is not set
+# USB_MOUSE_SUPPORT is not set
+# USB_MOUSE_SEQUENCE_SUPPORT is not set
+# USB_NET_SUPPORT is not set
+# DEBUG_USB_HID_KEYBOARD is not set
+# DEBUG_USB_HID_MOUSE is not set
+# ZBUS_SUPPORT is not set
+# ZBUS_RAW_SUPPORT is not set
+# ROUTER_SUPPORT is not set
+UIP_SUPPORT=y
+NET_SUPPORT=y
+# IPV6_SUPPORT is not set
+IPV4_SUPPORT=y
+# IP_FORWARDING_SUPPORT is not set
+# UIP_TIMEOUT_SUPPORT is not set
+CONF_ETHERRAPE_GATEWAY="192.168.115.100"
+# UIP_MULTI_STACK is not set
+# IPCHAIR_SUPPORT is not set
+# IPCHAIR_MASQ is not set
+TCP_SUPPORT=y
+# UDP_SUPPORT is not set
+# BROADCAST_SUPPORT is not set
+ICMP_SUPPORT=y
+# DNS_SUPPORT is not set
+CONF_DNS_SERVER="192.168.23.254"
+# BOOTP_SUPPORT is not set
+# BOOTP_TO_EEPROM_SUPPORT is not set
+# OPENVPN_SUPPORT is not set
+CONF_OPENVPN_KEY=00000000000000000000000000000000
+CONF_OPENVPN_HMAC_KEY=00000000000000000000000000000000
+CONF_OPENVPN_IP="0.0.0.0"
+CONF_OPENVPN_IP4_NETMASK="255.255.255.0"
+# OPENVPN_STATIC_REMOTE is not set
+# DEBUG_NET is not set
+# DEBUG_NET_CONFIG is not set
+# DEBUG_NET_IP6 is not set
+# DEBUG_OPENVPN is not set
+# DEBUG_ROUTER is not set
+# DEBUG_UIP is not set
+# DEBUG_NTP is not set
+# DEBUG_UNKNOWN_PACKETS is not set
+
+#
+# I/O
+#
+# CONFIG_IO_NONE is not set
+PORTIO_SCHEME=PORTIO_SIMPLE
+PORTIO_SIMPLE=y
+# PORTIO_FULL_FEATURED is not set
+PORTIO_SIMPLE_SUPPORT=y
+# NAMED_PIN_SUPPORT is not set
+TTY_SUPPORT=y
+TTY_COLS=16
+TTY_LINES=4
+TTY_LL_HD44780=y
+# TTY_LL_S1D15G10 is not set
+# TTY_LL_S1D13305 is not set
+# TTY_LL_VT100_TELNET is not set
+# DEBUG_TTY_LAYER is not set
+# HC595_SUPPORT is not set
+HC595_REGISTERS=5
+# HC165_SUPPORT is not set
+# HC165_INVERSE_OUTPUT is not set
+HC165_REGISTERS=1
+# ADC_SUPPORT is not set
+CONFIG_ADC_AREF=y
+# CONFIG_ADC_AVCC is not set
+# CONFIG_ADC_1_1 is not set
+# CONFIG_ADC_2_56 is not set
+ADC_REF=ADC_AREF
+# HR20_TEMP_SUPPORT is not set
+NEED_TEMP2TEXT=y
+# SMS_SUPPORT is not set
+SMS_USART_0=y
+# SMS_USART_1 is not set
+SMS_USE_USART=0
+# DEBUG_SMS is not set
+# KTY_SUPPORT is not set
+# ADS7822_SUPPORT is not set
+# DAC_SUPPORT is not set
+# TLC5620_SUPPORT is not set
+# LTC1257_SUPPORT is not set
+CONF_LTC1257_NUM_DEVICES=4
+# DEBUG_LTC1257_CORE is not set
+# DEBUG_LTC1257_ECMD is not set
+
+#
+# LCD Displays
+#
+HD44780_SUPPORT=y
+# HD44780_ORIGINAL is not set
+# HD44780_DISPTECH is not set
+# HD44780_KS0067B is not set
+HD44780_KS0066U=y
+# HD44780_WDC2704 is not set
+LCD_SUPPORT=y
+HD44780_CONNECTION=HD44780_DIREKT
+HD44780_DIREKT=y
+# HD44780_I2CSUPPORT is not set
+# HD44780_SERLCD is not set
+# HD44780_READBACK is not set
+# HD44780_MULTIENSUPPORT is not set
+# HD44780_BACKLIGHT_INV is not set
+# HR20_LCD_SUPPORT_FULL is not set
+# S1D15G10_SUPPORT is not set
+# ST7626_SUPPORT is not set
+# S1D13305_SUPPORT is not set
+# DEBUG_S1D13305 is not set
+LCD_SUPPORT=y
+# DEBUG_HD44780 is not set
+# DEBUG_LCD_MENU is not set
+# I2C_MASTER_SUPPORT is not set
+# I2C_DETECT_SUPPORT is not set
+# I2C_GENERIC_SUPPORT is not set
+# I2C_24CXX_SUPPORT is not set
+# I2C_LM75_SUPPORT is not set
+# I2C_DS1631_SUPPORT is not set
+# I2C_DS1337_SUPPORT is not set
+# I2C_TSL2550_SUPPORT is not set
+# I2C_PCA9531_SUPPORT is not set
+# I2C_PCF8574X_SUPPORT is not set
+# I2C_MAX7311_SUPPORT is not set
+# I2C_UDP_SUPPORT is not set
+# DEBUG_I2C is not set
+# CAMERA_SUPPORT is not set
+# DC3840_SUPPORT is not set
+# CONFIG_DC3840_RES80 is not set
+# CONFIG_DC3840_RES160 is not set
+# CONFIG_DC3840_RES320 is not set
+# CONFIG_DC3840_RES640 is not set
+# DC3840_HIGH_COMPRESSION is not set
+# DC3840_BLACK_WHITE is not set
+DC3840_USART_0=y
+# DC3840_USART_1 is not set
+DC3840_USE_USART=0
+# DC3840_UDP_DEBUG is not set
+# FS20_SUPPORT is not set
+# FS20_SEND_SUPPORT is not set
+# FS20_RECEIVE_SUPPORT is not set
+# FS20_RECEIVE_WS300_SUPPORT is not set
+# DEBUG_FS20_REC is not set
+# DEBUG_FS20_REC_QUEUE is not set
+# DEBUG_FS20_REC_VERBOSE is not set
+# DEBUG_FS20_WS300 is not set
+# DEBUG_FS20_WS300_VERBOSE is not set
+# RC5_SUPPORT is not set
+# RC5_SUPPORT is not set
+# RC5_UDP_SUPPORT is not set
+CONF_RC5_SERVER="192.168.100.3"
+# DEBUG_RC5 is not set
+# PSB2186_SUPPORT is not set
+# PWM_SUPPORT is not set
+# PWM_GENERAL_SUPPORT is not set
+# PWM_GENERAL_INVERT_SUPPORT is not set
+# PWM_GENERAL_FADING_SUPPORT is not set
+# CH_A_PWM_GENERAL_SUPPORT is not set
+# CH_B_PWM_GENERAL_SUPPORT is not set
+# CH_C_PWM_GENERAL_SUPPORT is not set
+# PWM_WAV_SUPPORT is not set
+# VFS_PWM_WAV_SUPPORT is not set
+# PWM_MELODY_SUPPORT is not set
+# ENTCHEN_PWM_MELODY_SUPPORT is not set
+# TETRIS_PWM_MELODY_SUPPORT is not set
+# PWM_SERVO_SUPPORT is not set
+PWM_SERVOS=1
+# PWM_SERVO_INVERT is not set
+# PWM_FREQ_SUPPORT is not set
+# PWM_DTMF_SUPPORT is not set
+# DEBUG_PWM is not set
+# DEBUG_PWM_SERVO is not set
+ONEWIRE_SUPPORT=y
+ONEWIRE_DETECT_SUPPORT=y
+# ONEWIRE_DS2502_SUPPORT is not set
+# ONEWIRE_DS2450_SUPPORT is not set
+# DEBUG_ECMD_OW_ROM is not set
+# DEBUG_ECMD_OW_LIST is not set
+# DEBUG_OW_DS2450_CORE is not set
+# DEBUG_OW_DS2450_ECMD is not set
+# HR20_INPUT_SUPPORT is not set
+# PS2_SUPPORT is not set
+# PS2_GERMAN_LAYOUT is not set
+# DEBUG_PS2 is not set
+# BUTTONS_INPUT_SUPPORT is not set
+CONF_NUM_BUTTONS=
+# GAME_INPUT_SUPPORT is not set
+# JOYSTICK_DIGITAL_SUPPORT is not set
+# DEBUG_JOYSTICK_DIGITAL is not set
+# DEBUG_GAME_INPUT is not set
+# RFM12_ASK_SUPPORT is not set
+# RFM12_ASK_SENDER_SUPPORT is not set
+# RFM12_ASK_2272_SUPPORT is not set
+# RFM12_ASK_1527_SUPPORT is not set
+# RFM12_ASK_TEVION_SUPPORT is not set
+# RFM12_ASK_INTERTECHNO_SUPPORT is not set
+# RFM12_ASK_EXTERNAL_FILTER_SUPPORT is not set
+# RFM12_ASK_SENSING_SUPPORT is not set
+# DEBUG_ASK_SENSE is not set
+# SHT_SUPPORT is not set
+# ZACWIRE_SUPPORT is not set
+# ZACWIRE_RAW_SUPPORT is not set
+# ZACWIRE_CONVERT306_SUPPORT is not set
+# ZACWIRE_CONVERT506_SUPPORT is not set
+# ULTRASONIC_SUPPORT is not set
+# DEBUG_ULTRASONIC is not set
+# HBRIDGE_SUPPORT is not set
+# DEBUG_HBRIDGE is not set
+# MCUF_SUPPORT is not set
+# MCUF_SERIAL_SUPPORT is not set
+MCUF_USART_0=y
+# MCUF_USART_1 is not set
+MCUF_USE_USART=0
+# MCUF_OUTPUT_SUPPORT is not set
+# BLP_SUPPORT is not set
+# LEDRG_SUPPORT is not set
+# MCUF_SERIAL_WORKAROUND_FOR_BAD_MCUF_UDP_PACKETS is not set
+# MCUF_SCROLLTEXT_SUPPORT is not set
+CONF_MCUF_SCROLLTEXT_STARTUP="Hi I am your ethersex ;-) "
+CONF_MCUF_SCROLLTEXT_STARTUP_COLOR=240
+CONF_MCUF_SCROLLTEXT_STARTUP_BG_COLOR=1
+CONF_MCUF_SCROLLTEXT_STARTUP_SPEED=2
+# MCUF_CLOCK_SUPPORT is not set
+# MCUF_CLOCK_AUTOSTART_SUPPORT is not set
+# MCUF_MODUL_SUPPORT is not set
+# MCUF_MODUL_CRON_SUPPORT is not set
+# MCUF_MODUL_DISPLAY_MODE_CRON_SEQUENCE is not set
+MCUF_MODUL_DISPLAY_MODE_CRON=MCUF_MODUL_DISPLAY_MODE_CRON_RANDOM
+MCUF_MODUL_DISPLAY_MODE_CRON_RANDOM=y
+# MCUF_MODUL_DISPLAY_MODE_SUPPORT is not set
+# MCUF_MODUL_DISPLAY_MODE_SEQUENCE is not set
+MCUF_MODUL_DISPLAY_MODE=MCUF_MODUL_DISPLAY_MODE_RANDOM
+MCUF_MODUL_DISPLAY_MODE_RANDOM=y
+# MCUF_MODUL_DISPLAY_MODE_MANUAL is not set
+# MCUF_TEST_GAME_INPUT is not set
+# MCUF_CHESS_SUPPORT is not set
+# MCUF_BOX_SUPPORT is not set
+# MCUF_CLEAN_SUPPORT is not set
+# MCUF_SPIRAL_SUPPORT is not set
+# MCUF_IMAGE_SUPPORT is not set
+# MCUF_MODUL_BORG16_SUPPORT is not set
+# MCUF_MODUL_BORG16_XONI_STUDY_SUPPORT is not set
+# MCUF_MODUL_BORG16_SNAKE_SUPPORT is not set
+# MCUF_MODUL_BORG16_SNAKE_INTERACTIVE_SUPPORT is not set
+# DEBUG_MCUF is not set
+
+#
+# Protocols
+#
+# ARTNET_SUPPORT is not set
+CONF_ARTNET_PORT=6454
+CONF_ARTNET_MAX_PORTS=4
+CONF_ARTNET_MAX_DATA_LENGTH=511
+CONF_ARTNET_MAX_CHANNELS=512
+CONF_ARTNET_OEM_ID="0xB108"
+# DEBUG_ARTNET is not set
+# DMX_SUPPORT is not set
+CONF_DMX_MAX_CHAN=512
+DMX_USART_0=y
+# DMX_USART_1 is not set
+DMX_USE_USART=0
+ECMD_PARSER_SUPPORT=y
+# ECMD_REMOVE_BACKSPACE_SUPPORT is not set
+# ALIASCMD_SUPPORT is not set
+# ECMD_PAM_SUPPORT is not set
+ECMD_SCRIPT_SUPPORT=y
+ECMD_SCRIPT_MAX_VARIABLES=4
+ECMD_SCRIPT_VARIABLE_LENGTH=10
+ECMD_SCRIPT_COMPARATOR_LENGTH=25
+ECMD_SCRIPT_MAXLINES=128
+# ECMD_SCRIPT_AUTOSTART_SUPPORT is not set
+# ECMD_SERIAL_USART_SUPPORT is not set
+ECMD_TCP_SUPPORT=y
+ECMD_TCP_PORT=2701
+# ECMD_UDP_SUPPORT is not set
+# ECMD_SERIAL_I2C_SUPPORT is not set
+# ECMD_USB_SUPPORT is not set
+# ECMD_JABBER_SUPPORT is not set
+# ECMD_IRC_SUPPORT is not set
+# ECMD_SMS_SUPPORT is not set
+ECMD_EEPROM_SUPPORT=y
+ECMD_SENDER_SUPPORT=y
+# UECMD_SENDER_SUPPORT is not set
+# DISABLE_IPCONF_SUPPORT is not set
+# DISABLE_REBOOT_SUPPORT is not set
+# IPSTATS_SUPPORT is not set
+# FREE_SUPPORT is not set
+# ECMD_MIRROR_REQUEST is not set
+# DEBUG_ECMD is not set
+# DEBUG_ECMD_FS20 is not set
+# DEBUG_ECMD_IP is not set
+# DEBUG_ECMD_MAC is not set
+# DEBUG_ECMD_NET is not set
+# DEBUG_ECMD_OW_LIST is not set
+# DEBUG_ECMD_OW_ROM is not set
+# DEBUG_ECMD_PORTIO is not set
+# DEBUG_ECMD_RC5 is not set
+# DEBUG_ECMD_SCRIPT is not set
+# HTTPLOG_SUPPORT is not set
+CONF_HTTPLOG_SERVICE="volkszaehler.org"
+CONF_HTTPLOG_PATH="/httplog/httplog.php"
+# CONF_HTTPLOG_INCLUDE_TIMESTAMP is not set
+# CONF_HTTPLOG_INCLUDE_UUID is not set
+CONF_HTTPLOG_UUID="12345678-9ABC-DEF0-1234-56789ABCDEF0"
+# DEBUG_HTTPLOG is not set
+# IRC_SUPPORT is not set
+CONF_IRC_IP="192.168.23.254"
+CONF_IRC_PORT=6667
+CONF_IRC_CHANNEL="ethersex"
+CONF_IRC_USERNAME="ethersex"
+CONF_IRC_NICKNAME="ethersex"
+CONF_IRC_REALNAME="Ethersex Wollmilchsau"
+# IRC_GREET_SUPPORT is not set
+# DEBUG_IRC is not set
+# MDNS_SD_SUPPORT is not set
+# MODBUS_SUPPORT is not set
+# MYSQL_SUPPORT is not set
+CONF_MYSQL_IP="192.168.23.254"
+CONF_MYSQL_USERNAME="root"
+CONF_MYSQL_PASSWORD="password"
+CONF_MYSQL_SCHEMA="mavisdb"
+# DEBUG_MYSQL is not set
+# NETSTAT_SUPPORT is not set
+CONF_NETSTAT_SERVICE_IP="188.40.33.175"
+CONF_NETSTAT_SERVICE="ethersex.de"
+CONF_NETSTAT_API="/~habo/stat/"
+# DEBUG_NETSTAT is not set
+# SOAP_SUPPORT is not set
+# SNMP_SUPPORT is not set
+# SENDMAIL_SUPPORT is not set
+CONF_SENDMAIL_IP="78.47.210.246"
+CONF_SENDMAIL_FROM="root@sex.metafnord.de"
+CONF_SENDMAIL_TO="stesie@brokenpipe.de"
+# SENDMAIL_AUTH_SUPPORT is not set
+# DEBUG_SENDMAIL is not set
+# SMS77_SUPPORT is not set
+CONF_SMS77_SERVICE="gateway.sms77.de"
+CONF_SMS77_USER=""
+CONF_SMS77_PASS=""
+CONF_SMS77_TO=""
+# SMS77_EEPROM_SUPPORT is not set
+# DEBUG_SMS77 is not set
+# SYSLOG_SUPPORT is not set
+CONF_SYSLOG_SERVER="192.168.23.73"
+# TWITTER_SUPPORT is not set
+CONF_TWITTER_SERVICE="identi.ca"
+CONF_TWITTER_API="/api"
+CONF_TWITTER_USERNAME="ethersex"
+CONF_TWITTER_PASSWORD=""
+CONF_TWITTER_AUTH="ZXRoZXJzZXg6"
+# DEBUG_TWITTER is not set
+# USTREAM_SUPPORT is not set
+CONF_USTREAM_IP="205.188.234.7"
+CONF_USTREAM_PORT=80
+# DEBUG_USTREAM is not set
+# YPORT_SUPPORT is not set
+YPORT_USART_0=y
+# YPORT_USART_1 is not set
+YPORT_USE_USART=0
+YPORT_PORT=7970
+YPORT_BAUDRATE=115200
+# MSR1_SUPPORT is not set
+MSR1_USART_0=y
+# MSR1_USART_1 is not set
+MSR1_USE_USART=0
+# DEBUG_MSR1 is not set
+# TO1_SUPPORT is not set
+TO1_USART_0=y
+# TO1_USART_1 is not set
+TO1_USE_USART=0
+TO1_SENSOR_COUNT=1
+# DEBUG_TO1 is not set
+# SERIAL_LINE_LOG_SUPPORT is not set
+SERIAL_LINE_LOG_USART_0=y
+# SERIAL_LINE_LOG_USART_1 is not set
+SERIAL_LINE_LOG_USE_USART=0
+SERIAL_LINE_LOG_TIMEOUT=20
+SERIAL_LINE_LOG_EOL=0A
+SERIAL_LINE_LOG_COUNT=60
+SERIAL_LINE_LOG_BAUDRATE=9600
+# SERIAL_LINE_LOG_SPACE_COMPRESSION is not set
+# DEBUG_SERIAL_LINE_LOG is not set
+# NMEA_SUPPORT is not set
+NMEA_USART_0=y
+# NMEA_USART_1 is not set
+NMEA_USE_USART=0
+# STELLA_PROTOCOL_SUPPORT is not set
+UDP_STELLA_PORT=2702
+# IOUDP_PROTOCOL_SUPPORT is not set
+UDP_IO_PORT=2703
+# MOTORCURTAIN_PROTOCOL_SUPPORT is not set
+UDP_MOTORCURTAIN_PORT=2704
+# CW_SUPPORT is not set
+CW_WPM=12
+# CW_BOOT_SUPPORT is not set
+# CW_BEACON_SUPPORT is not set
+# CW_PIN_SUPPORT is not set
+# CW_PWM_FREQ_SUPPORT is not set
+# CW_RFM12_ASK_SUPPORT is not set
+# DEBUG_CW is not set
+
+#
+# Applications
+#
+APP_SAMPLE_SUPPORT=y
+APP_SAMPLE_INIT_AUTOSTART_SUPPORT=y
+APP_SAMPLE_PERIODIC_AUTOSTART_SUPPORT=y
+# DEBUG_APP_SAMPLE is not set
+# BULBDIAL_SUPPORT is not set
+# DEBUG_BULBDIAL is not set
+CLOCK_SUPPORT=y
+CLOCK_DATETIME_SUPPORT=y
+# CLOCK_CRYSTAL_SUPPORT is not set
+CLOCK_CPU_SUPPORT=y
+# DCF77_SUPPORT is not set
+# DEBUG_DCF77 is not set
+# NTP_SUPPORT is not set
+# NTPD_SUPPORT is not set
+WHM_SUPPORT=y
+# TIMEZONE_UTC is not set
+TIMEZONE=TIMEZONE_CEST
+TIMEZONE_CEST=y
+# DEBUG_NTP_ADJUST is not set
+# CRON_SUPPORT is not set
+# CRON_DEFAULT_UTC is not set
+# CRON_SUPPORT_TEST is not set
+# CRON_VFS_SUPPORT is not set
+# DEBUG_CRON_DRYRUN is not set
+# DEBUG_CRON is not set
+# CRON_STATIC_SUPPORT is not set
+# DYNDNS_SUPPORT is not set
+# UDP_ECHO_NET_SUPPORT is not set
+# WOL_SUPPORT is not set
+# MOTD_SUPPORT is not set
+CONF_MOTD_DEFAULT="empty"
+CONF_MOTD_SIZE=50
+HTTPD_SUPPORT=y
+# HTTPD_SOAP_SUPPORT is not set
+# HTTPD_AUTH_SUPPORT is not set
+# HTTP_SD_DIR_SUPPORT is not set
+# MIME_SUPPORT is not set
+HTTPD_PORT=80
+HTTPD_ALTERNATE_PORT=8000
+# DEBUG_HTTPD is not set
+# JABBER_SUPPORT is not set
+CONF_JABBER_IP="78.47.210.246"
+CONF_JABBER_HOSTNAME="jabber.zerties.org"
+CONF_JABBER_USERNAME="esex"
+CONF_JABBER_PASSWORD="password"
+CONF_JABBER_RESOURCE="ethersex"
+CONF_JABBER_BUDDY="stesie@jabber.zerties.org"
+# JABBER_EEPROM_SUPPORT is not set
+# JABBER_STARTUP_MESSAGE_SUPPORT is not set
+# JABBER_LAST_SUPPORT is not set
+# JABBER_VERSION_SUPPORT is not set
+# DEBUG_JABBER is not set
+# MOODLIGHT_SUPPORT is not set
+MOODLIGHT_THRESHOLD_INIT=120
+# STELLA_SUPPORT is not set
+# STELLA_HIGHFREQ is not set
+STELLA_START=stella_start_zero
+stella_start_zero=y
+# stella_start_all is not set
+# stella_start_eeprom is not set
+STELLA_FADE_STEP_INIT=10
+STELLA_FADE_FUNCTION_INIT=stella_fade_func_0
+stella_fade_func_0=y
+# stella_fade_func_1 is not set
+# DEBUG_STELLA is not set
+# MOTORCURTAIN_SUPPORT is not set
+# MOTORCURTAIN_INVERTED_MOTOR is not set
+# MOTORCURTAIN_INVERTED_DIRECTION is not set
+# MOTORCURTAIN_INVERTED_SENSORS is not set
+# MOTORCURTAIN_INVERTED_SAFETYSWITCH is not set
+# MOTORCURTAIN_PROGRESS_SUPPORT is not set
+# TFTP_SUPPORT is not set
+# TFTPOMATIC_SUPPORT is not set
+# UPNP_SUPPORT is not set
+CONF_UPNP_MULTICAST_IP="239.255.255.250"
+CONF_UPNP_SCHEME_FILENAME="/ih.xml"
+# DEBUG_UPNP is not set
+# WATCHCAT_SUPPORT is not set
+# VNC_SUPPORT is not set
+VNC_PORT=5900
+# GUI_SUPPORT is not set
+# DEBUG_VNC is not set
+# WATCHASYNC_SUPPORT is not set
+CONF_WATCHASYNC_SERVER="volkszaehler.org"
+WATCHASYNC_SERVER_IP="78.46.142.232"
+CONF_WATCHASYNC_PORT=80
+CONF_WATCHASYNC_METHOD="POST"
+CONF_WATCHASYNC_PATH="/path/to/volkszaehler/backend.php/data/"
+CONF_WATCHASYNC_END_PATH=""
+# CONF_WATCHASYNC_TIMESTAMP is not set
+# CONF_WATCHASYNC_SUMMARIZE is not set
+CONF_WATCHASYNC_BUFFERSIZE=64
+# CONF_WATCHASYNC_EDGDETECTVIAPOLLING is not set
+
+#
+# Pin Configuration
+#
+
+#
+# Port A
+#
+# CONF_WATCHASYNC_PA0 is not set
+# CONF_WATCHASYNC_PA1 is not set
+# CONF_WATCHASYNC_PA2 is not set
+# CONF_WATCHASYNC_PA3 is not set
+# CONF_WATCHASYNC_PA4 is not set
+# CONF_WATCHASYNC_PA5 is not set
+# CONF_WATCHASYNC_PA6 is not set
+# CONF_WATCHASYNC_PA7 is not set
+
+#
+# Port B
+#
+# CONF_WATCHASYNC_PB0 is not set
+# CONF_WATCHASYNC_PB1 is not set
+# CONF_WATCHASYNC_PB2 is not set
+# CONF_WATCHASYNC_PB3 is not set
+# CONF_WATCHASYNC_PB4 is not set
+# CONF_WATCHASYNC_PB5 is not set
+# CONF_WATCHASYNC_PB6 is not set
+# CONF_WATCHASYNC_PB7 is not set
+
+#
+# Port C
+#
+# CONF_WATCHASYNC_PC0 is not set
+# CONF_WATCHASYNC_PC1 is not set
+# CONF_WATCHASYNC_PC2 is not set
+# CONF_WATCHASYNC_PC3 is not set
+# CONF_WATCHASYNC_PC4 is not set
+# CONF_WATCHASYNC_PC5 is not set
+# CONF_WATCHASYNC_PC6 is not set
+# CONF_WATCHASYNC_PC7 is not set
+
+#
+# Port D
+#
+# CONF_WATCHASYNC_PD0 is not set
+# CONF_WATCHASYNC_PD1 is not set
+# CONF_WATCHASYNC_PD2 is not set
+# CONF_WATCHASYNC_PD3 is not set
+# CONF_WATCHASYNC_PD4 is not set
+# CONF_WATCHASYNC_PD5 is not set
+# CONF_WATCHASYNC_PD6 is not set
+# CONF_WATCHASYNC_PD7 is not set
+# DEBUG_WATCHASYNC is not set
+# GLCD_MENU_SUPPORT is not set
+# GLCDMENU_S1D13305 is not set
+# DEBUG_GLCD_MENU is not set
+# RFM12_SUPPORT is not set
+IPV4_SUPPORT=y
View
9 services/brewtronic/Makefile
@@ -0,0 +1,9 @@
+TOPDIR ?= ../..
+include $(TOPDIR)/.config
+
+$(BREWTRONIC_SUPPORT)_SRC += services/brewtronic/brewtronic.c
+$(BREWTRONIC_SUPPORT)_ECMD_SRC += services/brewtronic/ecmd.c
+
+##############################################################################
+# generic fluff
+include $(TOPDIR)/scripts/rules.mk
View
BIN  services/brewtronic/Verdrahtung.odt
Binary file not shown
View
40 services/brewtronic/brew.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -w
+
+
+ use strict;
+ use Net::Telnet ();
+
+ my $esexip="192.168.115.99";
+ my $esexport="2701";
+ my $esex;
+my $sensor;
+ my $dummy;
+ my $temp;
+
+ $esex = Net::Telnet->new || die "kann Ethersex nicht finden";;
+ $esex->open(Host => $esexip,
+ Port => $esexport,
+ Timeout => 2);
+
+ $esex->print("brewset 0 60 5");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+ $esex->print("brewset 1 57 10");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+ $esex->print("brewset 2 63 45 ");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+ $esex->print("brewset 3 73 20 ");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+
+ $esex->print("brewset 4 78 1 ");
+
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+ $esex->print("brewsave");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+
+
View
400 services/brewtronic/brewtronic.c
@@ -0,0 +1,400 @@
+/*
+ * Copyright (c) 2009 by Stefan Riepenhausen <rhn@gmx.net>
+ *
+ */
+
+#define VERSION "rkBREW 0.44"
+
+#include <avr/pgmspace.h>
+#include <avr/eeprom.h>
+#include <avr/interrupt.h>
+#include "core/tty/tty.h"
+#include "core/debug.h"
+#include "core/eeprom.h"
+#include "core/bit-macros.h"
+
+#include "services/clock/clock.h"
+#include "hardware/onewire/onewire.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "config.h"
+#include "brewtronic.h"
+
+#include "protocols/ecmd/ecmd-base.h"
+
+// Encoder
+#define PHASE_A (PINC & 1<<PC3)
+#define PHASE_B (PINC & 1<<PC4)
+#define PUSH_ENC (PINC & 1<<PC5)
+// LED
+#define HEAT PC0
+#define BLUELED PC1
+#define REDLED PC2
+// BEEP
+#define BEEP PA7
+
+static uint16_t cur_time;
+
+// Status Variablen
+static int last_sec = 0;
+static int last_min = 0;
+static int phase = 0;
+static uint8_t start_proc = 0;
+static uint8_t brew_step = 255;
+static uint16_t progess=0;
+struct clock_datetime_t cur_date;
+
+static uint8_t rast_temp[MAX_BREW];
+static uint8_t rast_zeit[MAX_BREW];
+static uint8_t t_hist[MAX_HIST];
+static uint8_t hist_cnt = 0;
+static uint8_t hist_saved = 0;
+static uint16_t cur_temp;
+
+
+volatile int8_t enc_delta; // -128 ... 127
+static int8_t last;
+static int8_t started = 0;
+
+
+uint8_t ready = 0; // Fertig
+uint8_t process_pause = 0; // Programmierte Pause
+WINDOW *upper ;
+WINDOW *progress ;
+WINDOW *lower ;
+
+uint8_t up_heating = 1;
+uint8_t heat_time = 0;
+
+void reg_temp (uint8_t perc) {
+ if (brew_step == 255) { // start
+ brew_step = 0;
+ cur_time = 0;
+ if (cur_temp < rast_temp[brew_step]*2)
+ up_heating = 1;
+ else
+ up_heating = 0;
+ }
+ if (cur_temp < rast_temp[brew_step]*2) {
+ if (heat_time < perc) PORTC |= _BV(HEAT);
+ heat_time = (heat_time+1) % 10;
+
+ } else {
+ if (up_heating) {
+ up_heating = 0; // temp reached
+ cur_time = 0; // starte Rast
+ };
+ heat_time = 0;
+ PORTC &= ~ _BV(HEAT);
+ }
+ if (cur_time >= rast_zeit[brew_step]) {
+ brew_step++;
+ cur_time = 0;
+ up_heating = 1;
+ if (rast_zeit[brew_step] == 0 || rast_temp[brew_step] > 100) {
+ start_proc = 0; // ready!
+ ready = 1;
+ }
+ }
+}
+
+// Dekodertabelle für wackeligen Rastpunkt
+// halbe Auflösung
+//int8_t table[16] PROGMEM = {0,0,-1,0,0,0,0,1,1,0,0,0,0,-1,0,0};
+// Dekodertabelle für normale Drehgeber
+// volle Auflösung
+int8_t table[16] PROGMEM = {0,1,-1,0,-1,0,0,1,1,0,0,-1,0,-1,1,0};
+
+// struct ow_rom_code_t rom;
+/*
+ If enabled in menuconfig, this function is called during boot up of ethersex
+*/
+
+// 0..100
+void set_progress (int16_t percent) {
+ uint16_t stars;
+ uint16_t spaces;
+ uint8_t pausing = start_proc;
+ percent = percent<0 ? 0 : percent;
+ percent = percent>100 ? 100 : percent;
+ stars = 14*percent/100;
+ stars = stars>14 ? 14 : stars;
+ spaces = 14-stars;
+ wclear(progress);
+ if (pausing == 0)
+ wprintw(progress,"{");
+ else
+ wprintw(progress,"[");
+ if (stars > 0) {
+ while (stars--) {
+ wprintw(progress,":");
+ }
+ }
+ if (spaces > 0) {
+ while (spaces--) {
+ wprintw(progress," ");
+ }
+ }
+ if (pausing == 0)
+ wprintw(progress,"}");
+ else
+ wprintw(progress,"]");
+}
+
+uint8_t boot_wait ;
+int16_t
+brewtronic_init(void)
+{
+ boot_wait = 10;
+ BREWTRONICDEBUG ("init\n");
+ int16_t ret;
+ hist_saved=0;
+ hist_cnt=0;
+ upper = subwin(curscr,1,16,0,0);
+ progress = subwin(curscr,1,16,1,0);
+ lower = subwin(curscr,2,16,2,0);
+ clear();
+ wprintw(upper,VERSION);
+ wprintw(lower,__DATE__);
+ wprintw(lower,"\nStart...\n");
+ set_progress(0);
+ eeprom_restore(rast_temp_ee,rast_temp,MAX_BREW);
+ eeprom_restore(rast_zeit_ee,rast_zeit,MAX_BREW);
+ eeprom_restore(t_hist_ee,t_hist,MAX_HIST);
+ DDRC =(uint8_t) ~ 0xF8; // PC0..2 Outputs
+ DDRA = 0x80; // PA7 Output
+ PORTA = 0xff;
+ PORTC = 0xF8; // PULLUP
+
+ /* disable interrupts */
+ uint8_t sreg = SREG;
+ cli();
+ ret = ow_search_rom_first(ONEWIRE_BUSMASK);
+ /* re-enable interrupts */
+ SREG = sreg;
+
+ if (ret <= 0) {
+ return ECMD_FINAL_OK;
+ }
+ cur_time = 0;
+ return ECMD_FINAL_OK;
+}
+
+void BlueLed(char on)
+{
+ if (on == 1) {
+ PORTC |= _BV(BLUELED);
+ } else {
+ PORTC &= ~_BV(BLUELED);
+ }
+}
+
+/*
+ Run each 20 ms
+*/
+ uint8_t press_time = 0;
+ uint8_t release_time = 0;
+ uint8_t beep_time = 0;
+int16_t
+brewtronic_periodic(void)
+{
+ uint8_t i;
+ int16_t ret;
+ int16_t prog_state=0;
+ uint8_t sreg ;
+ uint8_t rast = brew_step==255?0:brew_step ;
+ struct ow_temp_scratchpad_t sp;
+ clock_current_localtime(&cur_date);
+ // Update beeper
+ if (beep_time > 0) {
+ beep_time--;
+ PORTA &= ~_BV(BEEP);
+ } else
+ PORTA |= _BV(BEEP);
+
+ // update rotary
+ last = (last << 2) & 0x0F;
+ if (PHASE_A) last |=2;
+ if (PHASE_B) last |=1;
+ enc_delta += pgm_read_byte(&table[last]);
+
+ // update button
+ if (PUSH_ENC != 0 && release_time > 0) release_time--;
+
+ if (PUSH_ENC == 0) {
+ if (press_time++ == 1 ) {
+ beep_time = 5;
+ start_proc = ! start_proc;
+ if (started==0) { // first start
+ started++;
+ for (i=0;i<MAX_HIST;i++) {
+ t_hist[i] = 255;
+ }
+ }
+ }
+ }
+ else {
+ release_time = 3;
+ press_time = 0;
+ }
+ // update LED
+ BlueLed(start_proc);
+
+ // once a second
+ if (cur_date.sec != last_sec) {
+ if (boot_wait>0) boot_wait--;
+ if (boot_wait == 0 ) {
+ last_sec = cur_date.sec;
+ if (start_proc) {
+ reg_temp(8);
+ } else
+ PORTC &= ~_BV(HEAT);
+ phase++;
+ phase &= 7; // 3 bits
+ switch (phase) {
+ case 0:
+ if (ready == 1) {
+ wprintw(lower,"Fertig! %2d\n",rast);
+ }
+ break;
+ case 1:
+ if (rast == 0)
+ wprintw(lower,"Einmaischen |%2d\n",up_heating);
+ else
+ wprintw(lower,"Rast: %2d %2d|%2d\n",
+ rast,rast_zeit[brew_step],up_heating);
+// case 5:
+ case 3:
+ wclear(upper);
+ wprintw(upper,"%2d %2d|%2d %2d|%2d.%1d",rast,cur_time,
+ rast_zeit[brew_step]==255?0:rast_zeit[brew_step],
+ rast_temp[brew_step]==255?0:rast_temp[brew_step],
+ cur_temp/2,cur_temp&1?5:0 );
+ prog_state = (cur_time*100)/rast_zeit[brew_step];
+ set_progress(prog_state);
+ if (ready == 1 && hist_saved==0) {
+ hist_saved = 1;
+ t_hist[hist_cnt<MAX_HIST-1?hist_cnt++:hist_cnt] = 255 ; // EOF
+ eeprom_save(t_hist_ee,t_hist,hist_cnt);
+ }
+ break;
+ case 6:
+ if (start_proc)
+ wprintw(lower,"Run Rast: %2d\n",rast);
+ else
+ wprintw(lower,"Stop Rast: %2d\n",rast);
+ if (PINC & _BV(HEAT))
+ wprintw(lower,"Heizen ein\n");
+ else
+ wprintw(lower,"Heizen aus\n");
+ break;
+ // Convert
+ case 4:
+// case 2:
+ case 7:
+ sreg = SREG;
+ cli();
+ ret = ow_temp_start_convert_wait(&ow_global.current_rom);
+ ret = ow_temp_read_scratchpad(&ow_global.current_rom, &sp);
+ /* re-enable interrupts */
+ SREG = sreg;
+ cur_temp = ow_temp_normalize(&ow_global.current_rom, &sp);
+ cur_temp = HI8(cur_temp)*2 + (LO8(cur_temp)>127?1:0);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ // each minute
+ if (cur_date.min != last_min ) {
+ last_min = cur_date.min;
+ if (!up_heating && start_proc) // running and not heating up
+ cur_time++;
+ if (start_proc && hist_cnt<MAX_HIST)
+ t_hist[hist_cnt++] = cur_temp;
+ }
+ return ECMD_FINAL_OK;
+}
+//
+// Commands
+//
+int16_t
+brew_start(uint8_t start_stop) {
+ BREWTRONICDEBUG ("set\n");
+ if (start_stop == 0) {
+ start_proc = 1;
+ } else {
+ start_proc = 0;
+ }
+ return ECMD_FINAL_OK;
+}
+
+char temp_str[10];
+char * TempToStr(uint16_t temp) {
+ snprintf(temp_str,9,"%3u.%1u",temp/2,temp&1?5:0);
+ return temp_str;
+}
+
+int16_t
+brew_temp(char *cmd, char *output, uint16_t len) {
+ return ECMD_FINAL(snprintf_P(output, len, PSTR("%s"),TempToStr(cur_temp)));
+}
+
+int16_t
+brew_set(uint8_t step, uint8_t temp, uint8_t mins) {
+ BREWTRONICDEBUG ("set\n");
+ wprintw(upper,"Set %d",step);
+ if (step < MAX_BREW) {
+ rast_zeit[step] = mins;
+ rast_temp[step] = temp;
+ }
+ return ECMD_FINAL_OK;
+}
+
+int16_t
+brew_save(char *cmd, char *output, uint16_t len){
+ BREWTRONICDEBUG ("save\n");
+ wprintw(upper,"Save");
+ BlueLed(1);
+ eeprom_save(rast_temp_ee,rast_temp,MAX_BREW);
+ eeprom_save(rast_zeit_ee,rast_zeit,MAX_BREW);
+ eeprom_save(t_hist_ee,t_hist,MAX_HIST);
+ //return ECMD_FINAL(snprintf_P(output, len, PSTR("rast_zeit: %u"),rast_zeit[0]));
+
+ return ECMD_FINAL_OK;
+}
+
+int16_t
+brew_restore(char *cmd, char *output, uint16_t len){
+ BREWTRONICDEBUG ("restore\n");
+ wprintw(upper,"Restore");
+ eeprom_restore(rast_temp_ee,rast_temp,MAX_BREW);
+ eeprom_restore(rast_zeit_ee,rast_zeit,MAX_BREW);
+ eeprom_restore(t_hist_ee,t_hist,MAX_HIST);
+ // return ECMD_FINAL(snprintf_P(output, len, PSTR("tim: %u"),rast_temp[0]));
+
+ return ECMD_FINAL_OK;
+}
+
+static int hist_restore_cnt=0;
+int16_t
+brew_history(char *cmd, char *output, uint16_t len) {
+ BlueLed(1);
+ if (t_hist[hist_restore_cnt] != 255 && hist_restore_cnt < MAX_HIST) {
+ return ECMD_AGAIN(snprintf_P(output, len, PSTR("%d,%s"),hist_restore_cnt,TempToStr(t_hist[hist_restore_cnt++])));
+ } else {
+ hist_restore_cnt = 0;
+ return ECMD_FINAL_OK;
+ }
+}
+
+/*
+ -- Ethersex META --
+ header(services/brewtronic/brewtronic.h)
+ ifdef(`conf_BREWTRONIC_INIT_AUTOSTART',`init(brewtronic_init)')
+ ifdef(`conf_BREWTRONIC_PERIODIC_AUTOSTART',`timer(2,brewtronic_periodic())')
+*/
View
60 services/brewtronic/brewtronic.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009 by Stefan Riepenhausen <rhn@gmx.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * For more information on the GPL, please go to:
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#ifndef HAVE_BREWTRONIC_H
+#define HAVE_BREWTRONIC_H
+
+int16_t
+brew_set(uint8_t step, uint8_t temp, uint8_t mins);
+int16_t
+brew_save(char *cmd, char *output, uint16_t len);
+int16_t
+brew_restore(char *cmd, char *output, uint16_t len);
+int16_t
+brew_start(uint8_t start_stop);
+int16_t
+brew_temp(char *cmd, char *output, uint16_t len);
+int16_t
+brew_save(char *cmd, char *output, uint16_t len);
+int16_t
+brew_restore(char *cmd, char *output, uint16_t len);
+int16_t
+brew_history(char *cmd, char *output, uint16_t len);
+
+
+int16_t
+brewtronic_init(void);
+
+int16_t
+brewtronic_periodic(void);
+
+#define MAX_BREW 20
+#define MAX_HIST 200
+
+#include "config.h"
+#ifdef DEBUG_BREWTRONIC
+# include "core/debug.h"
+# define BREWTRONICDEBUG(a...) debug_printf("app sample: " a)
+#else
+# define BREWTRONICDEBUG(a...)
+#endif
+
+#endif /* HAVE_BREWTRONIC_H */
View
6 services/brewtronic/config.in
@@ -0,0 +1,6 @@
+dep_bool_menu "Brewtronic brew control (EXPERIMENTAL)" BREWTRONIC_SUPPORT $CONFIG_EXPERIMENTAL
+ dep_bool "Method init auto start" BREWTRONIC_INIT_AUTOSTART_SUPPORT $BREWTRONIC_SUPPORT $CONFIG_EXPERIMENTAL
+ dep_bool "Method periodic auto start" BREWTRONIC_PERIODIC_AUTOSTART_SUPPORT $BREWTRONIC_SUPPORT $CONFIG_EXPERIMENTAL
+ comment "Debugging Flags"
+ dep_bool 'Application Sample Debug' DEBUG_BREWTRONIC $DEBUG $BREWTRONIC_SUPPORT
+endmenu
View
99 services/brewtronic/ecmd.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2009 by Stefan Riepenhausen <rhn@gmx.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * For more information on the GPL, please go to:
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <avr/io.h>
+#include <avr/pgmspace.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <util/delay.h>
+
+#include "config.h"
+#include "brewtronic.h"
+#include "protocols/ecmd/ecmd-base.h"
+
+int16_t parse_cmd_brew_set_command(char *cmd, char *output, uint16_t len)
+{
+ uint8_t step,temp,tim;
+ while (*cmd == ' ')
+ cmd++;
+ if (cmd[0]!=0)
+ sscanf_P(cmd, PSTR("%hu %hu %hu"), &step,&temp,&tim);
+
+ return brew_set(step, temp, tim);
+}
+
+int16_t parse_cmd_brew_save_command(char *cmd, char *output, uint16_t len)
+{
+ return brew_save(cmd,output,len);
+}
+
+
+int16_t parse_cmd_brew_temp_command(char *cmd, char *output, uint16_t len)
+{
+ return brew_temp(cmd,output,len);
+}
+
+int16_t parse_cmd_brew_restore_command(char *cmd, char *output, uint16_t len)
+{
+ return brew_restore(cmd,output,len);
+}
+
+int16_t parse_cmd_brew_hist_command(char *cmd, char *output, uint16_t len)
+{
+ return brew_history(cmd,output,len);
+}
+
+int16_t parse_cmd_brewtronic_init(char *cmd, char *output, uint16_t len)
+{
+ return brewtronic_init();
+}
+
+int16_t parse_cmd_brewtronic_periodic(char *cmd, char *output, uint16_t len)
+{
+ return brewtronic_periodic();
+}
+
+int16_t parse_cmd_brew_start_command(char *cmd, char *output, uint16_t len)
+{
+ uint8_t step;
+ while (*cmd == ' ')
+ cmd++;
+ if (cmd[0]!=0)
+ sscanf_P(cmd, PSTR("%hu"), &step);
+
+ return brew_start(step);
+
+}
+
+/*
+-- Ethersex META --
+block([[Brewtronic]])
+ecmd_feature(brew_set_command, "brewset",[step] [temp] [time], Set rast)
+ecmd_feature(brew_restore_command, "brewrest",, restore)
+ecmd_feature(brew_save_command, "brewsave",, save)
+ecmd_feature(brew_start_command, "brewstart",, save)
+ecmd_feature(brew_temp_command, "brewtemp",, save)
+ecmd_feature(brew_hist_command, "brewhist",, save)
+ecmd_feature(brewtronic_init, "brewinit",, Manually call application sample init method)
+ecmd_feature(brewtronic_periodic, "brewperiodic",, Manually call application sample periodic method)
+*/
View
2  services/brewtronic/flash.sh
@@ -0,0 +1,2 @@
+#
+ avrdude -p m644p -P usb -i 2 -c avrisp2 -U flash:w:ethersex.hex
View
2  services/brewtronic/fuse.sh
@@ -0,0 +1,2 @@
+#
+ avrdude -p m644p -P usb -i 2 -c avrisp2 -U lfuse:w:0xe7:m -U hfuse:w:0xdc:m
View
53 services/brewtronic/ow.pl
@@ -0,0 +1,53 @@
+#!/usr/bin/perl -w
+ #Auslesen der 1 Wire Sensoren an einem AVR-NET-IO mit ethersex
+
+ use strict;
+ use Net::Telnet ();
+
+ my $esexip="192.168.115.99";
+ my $esexport="2701";
+ my $esex;
+ my @sensor;
+ my $sensor;
+ my $dummy;
+ my $temp;
+
+ $esex = Net::Telnet->new || die "kann Ethersex nicht finden";;
+ $esex->open(Host => $esexip,
+ Port => $esexport,
+ Timeout => 2);
+
+ #Alles Sensor-IDs auslesen und dem Array @sensor zuweisen
+ $esex->print("1w list");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+ @sensor=split(/\s+/, $sensor);
+ print "@sensor","\n"; #Kontrollausgabe
+
+ my $zahler=@sensor;
+ print "Anzahl der Elemente :",$zahler,"\n\n";
+
+ #Alles Sensore Temperatur einlesen
+ $esex->print("1w convert");
+ $esex->waitfor(Timeout => 2,
+ String => "OK");
+
+ #Sensor ID inklusive Wert ausgeben
+ foreach (@sensor) {
+ $esex->print("1w get $_");
+
+ ($dummy,$temp)=$esex->waitfor(Match =>'/[-]?\d+\.\d+/',
+ Timeout => 5);
+
+ print "Temperatur vom ID ",$_,": ",$temp,"","\n";
+ $esex->print("hostname");
+
+ my $hostn;
+ ($dummy,$hostn)=$esex->waitfor( Timeout => 5, Match =>'/[0-9A-Za-z]+/');
+ print $hostn," $dummy";
+
+ $esex->print("lcd clear");
+ $esex->waitfor(Timeout => 2, String => "OK");
+ $esex->print("lcd write Hello World! $temp");
+ $esex->waitfor(Timeout => 2, String => "OK");
+ }
View
151 services/brewtronic/stout.txt
@@ -0,0 +1,151 @@
+0, 39.5
+1, 41.0
+2, 41.0
+3, 41.5
+4, 41.5
+5, 41.5
+6, 41.5
+7, 41.5
+8, 41.5
+9, 41.5
+10, 41.5
+11, 41.5
+12, 41.5
+13, 41.5
+14, 41.0
+15, 41.0
+16, 41.0
+17, 41.0
+18, 41.0
+19, 41.0
+20, 41.0
+21, 41.0
+22, 42.0
+23, 43.5
+24, 44.5
+25, 46.0
+26, 47.0
+27, 48.5
+28, 50.0
+29, 51.0
+30, 52.5
+31, 53.5
+32, 55.0
+33, 56.0
+34, 57.0
+35, 58.5
+36, 59.5
+37, 61.0
+38, 62.0
+39, 63.5
+40, 64.5
+41, 66.0
+42, 67.0
+43, 67.0
+44, 67.0
+45, 67.0
+46, 66.5
+47, 66.5
+48, 66.5
+49, 66.5
+50, 66.0
+51, 66.0
+52, 66.0
+53, 65.5
+54, 66.0
+55, 66.5
+56, 66.0
+57, 66.0
+58, 66.0
+59, 66.0
+60, 65.5
+61, 66.0
+62, 66.0
+63, 66.0
+64, 66.0
+65, 66.0
+66, 66.0
+67, 66.0
+68, 66.0
+69, 66.0
+70, 66.0
+71, 66.0
+72, 66.0
+73, 66.0
+74, 66.0
+75, 66.5
+76, 66.5
+77, 66.0
+78, 66.0
+79, 66.0
+80, 66.0
+81, 65.5
+82, 66.0
+83, 66.5
+84, 66.5
+85, 66.0
+86, 66.0
+87, 66.0
+88, 66.0
+89, 66.0
+90, 66.0
+91, 66.0
+92, 66.0
+93, 66.0
+94, 66.0
+95, 66.0
+96, 66.0
+97, 65.5
+98, 66.0
+99, 66.0
+100, 66.0
+101, 66.0
+102, 66.0
+103, 65.5
+104, 66.0
+105, 66.0
+106, 66.0
+107, 66.0
+108, 66.0
+109, 66.0
+110, 66.0
+111, 65.5
+112, 66.0
+113, 66.5
+114, 66.5
+115, 66.5
+116, 66.0
+117, 66.0
+118, 66.0
+119, 66.0
+120, 65.5
+121, 66.0
+122, 66.5
+123, 66.5
+124, 66.0
+125, 66.0
+126, 66.0
+127, 66.0
+128, 65.5
+129, 65.5
+130, 66.5
+131, 66.5
+132, 67.5
+133, 68.5
+134, 69.5
+135, 71.0
+136, 72.0
+137, 73.0
+138, 74.0
+139, 75.5
+140, 76.5
+141, 76.5
+142, 76.5
+143, 76.5
+144, 76.5
+145, 76.5
+146, 76.0
+147, 76.0
+148, 76.0
+149, 75.5
+
View
31 services/brewtronic/test.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl -w
+
+
+ use strict;
+ use Net::Telnet ();
+
+ my $esexip="192.168.115.99";
+ my $esexport="2701";
+ my $esex;
+my $sensor;
+ my $dummy;
+ my $temp;
+
+ $esex = Net::Telnet->new || die "kann Ethersex nicht finden";;
+ $esex->open(Host => $esexip,
+ Port => $esexport,
+ Timeout => 2);
+
+ $esex->print("brewset 0 23 2");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+ $esex->print("brewset 1 26 3");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+
+
+ $esex->print("brewsave");
+ ($sensor) = $esex->waitfor(Timeout => 2,
+ String => "OK");
+
+

No commit comments for this range

Something went wrong with that request. Please try again.