Hauptmenü

culfw@ARM

Begonnen von Telekatz, 22 Juni 2015, 22:42:29

Vorheriges Thema - Nächstes Thema

Olly

Zitat von: Telekatz am 23 August 2015, 20:23:15
Außerdem habe ich auch noch die Netzwerkunterstützung für den Cube mit in die a-culfw eingecheckt.
Hallo,

heißt das, dass man den Cube jetzt quasi wie einen CUNO (CUL im Netzwerk, ohne USB) verwenden kann? Da würde ich mir glatt einen Cube schießen und via PowerLAN an geeigneter Stelle platzieren um meine Reichweite zu erhöhen.

Gruß

     Olly
BananaPi 1GB;NetCSM 868MHz, miniCUL 433MHz, LaCrosseGateway, 2x SignalESP; FHEM 6.2

Telekatz

Man kann ihn wie einen CUN benutzen. Ein CUNO hat zusätzlich noch 1Wire.

adb76

Hallo Telekatz,

super, da werde ich auch direkt mal meinen Cube umwidmen!
Eine Frage noch hierzu: wenn ich den Cube über USB anschließe, welche Baudrate nehme ich dann bei der Definition des CUL in Fhem? 9600, 38400, 115200 oder ganz was anderes?

Danke und Gruß.

Telekatz

Da ja nicht wirklich eine RS232 Verbindung existiert ist das eigentlich egal. Es funktioniert auch mit 42 Baud.

adb76

So, habe heute meinen CUBE entsprechend geflasht. Er empfängt auch die opened/closed Stati von meinen MAX! Fenstersensoren. Soweit ok.

Aber: Es kommen permanent irgendelche Daten über die Schnittstelle, was dazu führt, dass einzelne Telegramme verwurstelt werden bzw. FHEM bei einem "shutdown restart" komplett blockiert und erst weiterläuft, wenn ich den CUBE abziehe. Habe mal mit einem Verbose 5 auf den CUL geloggt, was dann so aussieht:

2015.08.26 20:38:29 3: Setting CUL_0 serial parameters to 9600,8,N,1
2015.08.26 20:38:29 1: /dev/serial/by-id/usb-03eb_AT91USBSerial1-if00 reappeared (CUL_0)
2015.08.26 20:38:29 5: SW: V
2015.08.26 20:38:29 5: CUL/RAW (ReadAnswer): V 1.65 CUBe

2015.08.26 20:38:29 5: SW: ?
2015.08.26 20:38:29 5: CUL/RAW (ReadAnswer): ? (? is unknown) Use one of B C F i A Z E G M K U Y R T V W X e f l t x

2015.08.26 20:38:29 3: CUL_0: Possible commands: BCFiAZEGMKUYRTVWXefltx
2015.08.26 20:38:29 5: SW: X21
2015.08.26 20:38:29 5: SW: Zr
2015.08.26 20:38:29 5: SW: Za123456
2015.08.26 20:38:29 5: SW: Zw111111
2015.08.26 20:38:29 5: SW: T01
2015.08.26 20:38:29 5: CUL/RAW (ReadAnswer): 1034

2015.08.26 20:38:29 5: GOT CUL fhtid: 1034
2015.08.26 20:38:30 5: CUL/RAW: /
2015.08.26 20:38:30 5: CUL/RAW: /
2015.08.26 20:38:32 5: CUL/RAW: /�
2015.08.26 20:38:32 5: CUL/RAW: �/
2015.08.26 20:38:32 5: CUL/RAW: �/
2015.08.26 20:38:33 5: CUL/RAW: �/
2015.08.26 20:38:33 5: CUL/RAW: �/
2015.08.26 20:38:34 5: CUL/RAW: �/
2015.08.26 20:38:34 5: CUL/RAW: �/�
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:34 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/
2015.08.26 20:38:35 5: CUL/RAW: ��/�
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:35 5: CUL/RAW: ���/
2015.08.26 20:38:36 5: CUL/RAW: ���/�
2015.08.26 20:38:36 5: CUL/RAW: ����/
2015.08.26 20:38:36 5: CUL/RAW: ����/�
2015.08.26 20:38:36 5: CUL/RAW: �����/
2015.08.26 20:38:36 5: CUL/RAW: �����/0
2015.08.26 20:38:36 5: CUL/RAW: �����0/
2015.08.26 20:38:36 5: CUL/RAW: �����0/
2015.08.26 20:38:36 5: CUL/RAW: �����0/
2015.08.26 20:38:36 5: CUL/RAW: �����0/
2015.08.26 20:38:36 5: CUL/RAW: �����0/�
2015.08.26 20:38:36 5: CUL/RAW: �����0�/
2015.08.26 20:38:36 5: CUL/RAW: �����0�/
2015.08.26 20:38:36 5: CUL/RAW: �����0�/�
2015.08.26 20:38:36 5: CUL/RAW: �����0��/`
2015.08.26 20:38:36 5: CUL/RAW: �����0��`/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`/~
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~/?
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?/�
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:36 5: CUL/RAW: �����0��`~?�/
2015.08.26 20:38:37 5: CUL/RAW: �����0��`~?�/?>>�


list CUL_0 ergibt:
Internals:
   CMDS       BCFiAZEGMKUYRTVWXefltx
   CUL_0_MSGCNT 1
   CUL_0_TIME 2015-08-26 20:39:03
   Clients    :CUL_MAX:HMS:CUL_IR:STACKABLE_CC:
   DEF        /dev/serial/by-id/usb-03eb_AT91USBSerial1-if00@9600 1034
   DeviceName /dev/serial/by-id/usb-03eb_AT91USBSerial1-if00@9600
   FHTID      1034
   NAME       CUL_0
   NR         146
   PARTIAL
   RAWMSG     Z0B1A06300FFDEA123456001029
   RSSI       -53.5
   STATE      disconnected
   TYPE       CUL
   VERSION    V 1.65 CUBe
   initString X21
Zr
Za123456
Zw111111
   CHANGETIME:
   Helper:
     Dblog:
       State:
         Mydblog:
           TIME       1440614349.80468
           VALUE      DISCONNECTED
   Matchlist:
     1:CUL_MAX  ^Z........................
     8:HMS      ^810e04....(1|5|9).a001
     D:CUL_IR   ^I............
     H:STACKABLE_CC ^\*
   Readings:
     2015-08-26 20:23:05   ccconf          freq:868.300MHz bWidth:101KHz rAmpl:33dB sens:8dB
     2015-08-26 20:38:29   cmds             B C F i A Z E G M K U Y R T V W X e f l t x
     2015-08-15 09:40:39   credit10ms      900
     2015-08-13 20:05:19   fhtbuf          AE
     2015-08-26 20:39:09   state           disconnected
     2015-08-26 20:23:10   version         V 1.65 CUL868
Attributes:
   rfmode     MAX
   verbose    5


Habe auch schon versucht neu geflasht, aber irgendwie sendet der CUBE dauernd. Woran kann das liegen?  :(

Danke und Gruß.

P.S. mit eine CUL 868 in der gleichen Konfiguration habe ich diese Probleme nicht.

Telekatz

Klingt so, als ob es das gleiche Problem wie bei Blizzard ist. Probier mal die neueste Version, die in der a-culfw enthalten ist: https://www.mediafire.com/folder/tf16radvztfd9/a-culfw

Blizzard

Ich habe seit gestern die neuste Version drauf.Sowohl der Datenmüll ist verschwunden (auch ohne Hardware-Pullup ;D), als auch die Netzwerk-Funktionalität funktioniert bisher fehlerfrei. 2x 100 Punkte! 8)
Ich betreibe den "Cube-CUNO" zusammen mit Homegear um ein paar Homematic-Geräte zu steuern. :)

adb76

#22
Zitat von: Telekatz am 26 August 2015, 20:59:36
Klingt so, als ob es das gleiche Problem wie bei Blizzard ist. Probier mal die neueste Version, die in der a-culfw enthalten ist: https://www.mediafire.com/folder/tf16radvztfd9/a-culfw

Super! Das war's! Erste Tests sehen sehr gut aus.

Vielen Dank!

EDIT: Ich hatte nach einem Neustart von FHEM plötzlich Probleme, dass mein Fensterkontakte den Status "opened (rf error)" oder "closed (rf error)" hatten. Im Log war daneben noch folgendes zu finden:

2015.08.26 22:17:08 1: PERL WARNING: Argument "04 a-culfw Build: 151 (2015-08-25_20-48-08) CUBe (F-Band..." isn't numeric in addition (+) at ./FHEM/14_CUL_MAX.pm line 147.
2015.08.26 22:17:08 2: CUL_MAX_Check: You are using an old version of the CUL firmware, which has known bugs with respect to MAX! support. Please update


Nach Durchsicht von 14_CUL_MAX habe ich festgestellt, dass offensichtlich in Abhängigkeit von der Firmware-Version die Initialisierung anders verläuft. Nachdem ich mal versuchsweise in 14_CUL_MAX die Version hart auf 165 gesetzt habe (aktuelle Original-Firmware) läuft es nun wieder. Werde den Punkt mal im MAX-Unterforum melden.

stenny73

Kann man man Cube eigentlich eine feste IP einstellen?
FHEM auf XEN, Ubuntu-Server 14.04   - HM-Lan - Max - ZWave -WS1080 -BlueTooth

FHEM auf Ubuntu-Server 14.04   - HM-LAN

FHEM auf Raspberry Pi   - CSM für Max - HM-USB - WiFi-LED

Blizzard

Zitat von: stenny73 am 28 August 2015, 20:14:02
Kann man man Cube eigentlich eine feste IP einstellen?

Ja, das ist kein Problem, hier gibts ein Beispiel dafür http://culfw.de/commandref.html

ZitatSample CUN(O) setup

This section describes how to setup CUN for ethernet access with the following settings:
  DCHP client:      off
  IP address/netmask:   192.168.31.126/255.255.255.0
  Gateway:      192.168.31.1
  NTP server:      192.168.31.2
  Time zone offset:   GMT+2
Connect CUN to your PC via USB. On Linux a device /dev/ttyACM0 will appear (on subsequent experiments, the device may be named /dev/ttyACM1, /dev/ttyACM2 and so forth). Use screen /dev/ttyACM1 to talk to CUN and screen /dev/ttyACM1@38400 for CUNO. Enter the following commands:
  V                     output version, e.g. V 1.39 CUN
  Wid00                 disable DHCP
  Rid
  Wia192.168.31.126     set IP address
  Ria
  Wig192.168.31.1       set gateway
  Rig
  Win255.255.255.0      set netmask
  Rin
  WiN192.168.31.2       set NTP server
  RiN
  Wio02                 set time zone offset
  Rio
  En                    request time from NTP server
  c03                   show date and timeslot

Joachim

Moin Telekatz,

danke ersteinmal für die Portierung.
für Dich und andere vielleicht interessant, mein CUBE hat einen at91sam7x512 an Board.

Jetzt zu meinem eigentlichen Problem:
Wegen des MAX-Problems:
Zitat adb76
ZitatNach Durchsicht von 14_CUL_MAX habe ich festgestellt, dass offensichtlich in Abhängigkeit von der Firmware-Version die Initialisierung anders verläuft. Nachdem ich mal versuchsweise in 14_CUL_MAX die Version hart auf 165 gesetzt habe (aktuelle Original-Firmware) läuft es nun wieder. Werde den Punkt mal im MAX-Unterforum melden.
wollte ich mir eine "frisierte" Firmware selber Kompilieren, dabei komme allerdings auf keinen grünen Zweig, vielleicht kannst Du mir dabei helfen, das Problem zu finden.
Virtuelle Maschine mit Ubuntu 12:04 aufgesetzt,
den von Dir vorgeschlagenen Toolchain als ppa ( https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded )installiert,
im CUBe-Verzeichnis make ausgeführt,
keine Fehlermeldungen erhalten,
die gebaute CUBE_BL.bin mit CuteCom auf den Cube geschoben,
und geht nicht,
die von Dir kompilierte bin (a-culfw_1.05.04_build_151_master   CUBE_BL.bin) funktioniert.
Ich denke, ich habe eine Kleinigkeit vergessen, nur welche?
Wenn weitere Infos benötgt werden, bescheid sagen.

Gruß Joachim
FHEM aktuellste Version auf FB 7570 und 7390 mit Zebradem Toolbox Freetz
FHEM auf Raspberry
1-Wire mit LinkUSBi und Rs-Pi ds2482-800  1-Wire-9 Board; Max mit Cube, HMLAN
div. 1-Wire Sensoren; MAX-Thermostaten; Homematic-Komponenten, Zehnder KWL über RS-232

Telekatz

Hast du die Version 4.9 installiert? Die hat bei mir nicht funktioniert. Deshalb verwende ich die Version 4.8.

Joachim

#27
Danke Telekatz, guter Tipp,
es ist die Version 4.9.3.
Werde das jetzt mal mit der Version 4.8 versuchen, und mich bei Problemen nocheinmal melden.

Gruß Joachim

Edith:
So, jetzt diese Version genommen:
https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major
gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2
Makefile angepasst:
###############################################################
#####
##### Makefile for boop - OpenSource firmware for Betty
##### Created at 30.8.2007 02:26 am
#####
##### boop V0.1 by netguy - ck@mamalala.net
##### Makefile V0.1 by alterego - alteregon@gmx.net
##### Makefile v0.2 by Tobias - tobias-betty@23.gs
#####
###############################################################

###############################################################
#####
##### PATHS (default installation)
#####
##### You can put your path-config into Makefile.local
##### to override these defaults
#####
###############################################################

ARMBASE = /home/joachim/Downloads/gcc-arm-none-eabi-4_8-2013q4     <------------------------------------------

INCLUDEPATH = $(ARMBASE)/arm-none-eabi/include
LIBPATH = $(ARMBASE)/arm-none-eabi/lib
ARMPATH = $(ARMBASE)/bin/                                   <-------------------------------------------------------------
TOOLPREFIX = arm-none-eabi-
OPENOCDPATH = F:\Tools\OpenOCD
OPENOCD = $(OPENOCDPATH)\openocd.exe -f $(OPENOCDPATH)\target\sam7x256.cfg -f $(OPENOCDPATH)\interface\uniprog.cfg

GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d

make gestartet, und geflasht.
--> es geht!

Gruß Joachim
FHEM aktuellste Version auf FB 7570 und 7390 mit Zebradem Toolbox Freetz
FHEM auf Raspberry
1-Wire mit LinkUSBi und Rs-Pi ds2482-800  1-Wire-9 Board; Max mit Cube, HMLAN
div. 1-Wire Sensoren; MAX-Thermostaten; Homematic-Komponenten, Zehnder KWL über RS-232

chapelhill

#28
Thanks in advance for all the effort by everybody towards FHEM and firmwares.
Sorry for post in English, but I am struggling a little installing to Max cube.

I think I have successfully deleted previous firmware, by shorting J1, connecting USB, disconnecting short on J1, waiting for a second or so, hear usb drop and reconnect from computer notification then power off by disconnecting USB. When firmware has been deleted and you power back on light D1 is then permanently out. (Normally it should be on solid to indicate power on in normal mode with firmware loaded?)
I think I have loaded the boot loader with the SAM-BA software as D1 is now flashing approx 3 times per second when powered on, but I can't get past that stage to get the firmware loaded.

I used the instructions from the Atmel  sam-ba Software to install its USB driver, which installed ok.

Started the software
Connected to the device as per instructions
Loaded the Bin file
Pressed the send
To the question about wanting to lock the involved lock regions, I say no, then
execute the script to boot from flash.

This is the log output from SAM-BA session:


loading history file ... 0 events added
SAM-BA console display active (Tcl8.5.9 / Tk8.5.9)
(sam-ba_2.15) 1 %
(sam-ba_2.15) 1 % send_file {Flash} "C:/Users/Alastair/Documents/raspberry/CULstuff/originalfw/bootloader_CUBE.bin" 0x100000 0
-I- Send File C:/Users/Alastair/Documents/raspberry/CULstuff/originalfw/bootloader_CUBE.bin at address 0x100000
first_sector 0 last_sector 0
-I-    Writing: 0x3A6C bytes at 0x0 (buffer addr : 0x202A24)
-I-    0x3A6C bytes written by applet
Do not lock
(sam-ba_2.15) 1 % FLASH::ScriptGPNMV 4
-I- GPNVM2 set
(sam-ba_2.15) 1 %



Then on powering back off and back on the D1 light is now flashing approx 3 times per second, which I think indicates it has booted in boot loader mode as it has no firmware.

The USB is still detected as a AT91 USB to serial converter but to a different com port.

I then start up the teraterm software.
Connect to the port
File > Transfer > XMODEM > Send
Select the bin file from the dialogue and it start writing ok, but progress window seems to disappear before it finishes entirely (about half way), and you hear the USB disconnect and re-connect notification.
The light D1 is still flashing at about 3 times per second.

If I disconnect and re-connect the power the D1 led is still flashing at 3 times per second.
I think that means the Firmware flash has not worked.

How long does the flash process take?
Any suggestions as to what I am doing wrong.

I am also a little unclear as to which version of the firmware allows the device to function as a CUN. (IP based CUL device.)

Hopefully there are some instructions in here which might help some other users past the bit I have been able to get to.

I have attached document with screenshots to help other people if it can, and perhaps to help someone show me the error of my ways?

Regards
Chapelhill






Telekatz

Your procedure looks good for me. I think it is the same problem that Blizzard noticed with the missig pull up resistor on the debug port. This could lead to disconnect the USB connection before teraterm can upload the entire firmware. I fixed this problem in the a-culfw version.

You can find the a-culfw on https://github.com/heliflieger/a-culfw. The compiled binaries are available on https://www.mediafire.com/folder/tf16radvztfd9/a-culfw.
Try again with the bootloader and the firmware from Build 151.

Regards
Alex