Friday, November 17, 2023

Lectura automatizada de SMS recibidos - Androwish

Encontre' la siguiente aplicacion en androwish:

https://chiselapp.com/user/gwlester/repository/AndroWishApplications/finfo?name=ReadMessages.tcl

solo funciona la version inicial del repositorio, la mas reciente parece ser un trabajo en proceso.
de hecho, la version inicial tiene un problema en este proc:
##
## Translate the phone number to a name if the phone number is in the phone book
##
proc lookupName {phoneNumber} {
 

Sunday, November 12, 2023

Ensamblador - retomando el estudio (ATTiny85)

1) De las mejores explicaciones que me he encontrado:
 
2) Involucrando Tcl - Un ensamblador muy particular para el ATTiny85.
Muy interesante, Ademas.
    La seccion de la presentacion de Uli Ender tiene 5 links:
        2.1) El pdf de la presentacion.
        2.2) El set de archivos en un zip
        2.3) Raspberry-Pi via SPI-interface (EuroTcl 2017)
        2.4) Raspberry-Pi and other I2C-chips (EuroTcl 2018)
        2.5) Dropbox-uploader
 
Vimos la pelicula:
"La memoria infinita", documental Chileno, en un dia lluvioso.
Muy emotiva y con bonitas canciones.


Wednesday, November 8, 2023

Interesting videos - November 2023

Excel VBA - Easily parse XML data from a file or website using XML

 

Friday, April 28, 2023

Favorite YouTube Videos

 


Sunday, September 18, 2022

Enviando SMS desde Androwish

Basado en:

https://wiki.tcl-lang.org/page/AndroWish+Questions

Pude enviar SMS de manera semi-automatica.(Ya que debo presionar el boton "Send" cada vez).

Pero al menos puedo crear una secuencia pre-establecida y facilitar la programacion de, por ejemplo, el modulo GA09.

http://www.waferstar.com/downloads/GA09.pdf

console show
proc sendSMS {tel msg} {
  ## popup a form for sending an SMS with the given data
  borg activity android.intent.action.VIEW $tel "vnd.android-dir/mms-sms" {} {} [list sms_body $msg]
}

sendSMS 1234567890 "this is a test SMS [clock seconds]"
tk_messageBox -message "OK"
puts Done1
sendSMS 1234567890 "Este es un 2do msg SMS [clock seconds]"
puts Done2

El truco es presionar el boton "back" en la aplicacion de SMS para poder ver el messageBox y poder continuar con el flujo del programa.

 

Sunday, December 13, 2020

w3m, sed y scripts en bash

Material interesante acerca de scripting en bash, sed y w3m
Wikidates - Having fun on the bash command line
https://www.youtube.com/watch?v=NYGI5xh4Llc

Saturday, May 9, 2020

Formateando discos en Linux


Aqui viene todo lo que necesite'

lsblk
parted

lo unico que tuve que agregar fue reformatear en el ambiente grafico con Disks y ponerle NTFS ya que me aparecia el disco sin permisos

Luego entonces...


jorge@jorge-negra:~$ sudo fdisk -l

Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders, total 160836480 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x101e9f2f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    96422129    48211033+   7  HPFS/NTFS/exFAT
/dev/sda2        96423934   160826714    32201390+   5  Extended
/dev/sda5       158079663   160826714     1373526   82  Linux swap / Solaris
/dev/sda6        96423936   158078975    30827520   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ca524

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   488396799   244197376    7  HPFS/NTFS/exFAT
 

jorge@jorge-negra:~$ mkdir /media/usb-drive
mkdir: cannot create directory ‘/media/usb-drive’: Permission denied
 

jorge@jorge-negra:~$ sudo mkdir /media/usb-drive
 

jorge@jorge-negra:~$ mount /dev/sdb1 /media/usb-drive/
mount: only root can do that
 

jorge@jorge-negra:~$ sudo mount /dev/sdb1 /media/usb-drive/
 

jorge@jorge-negra:~$ cd /media/usb-drive/
 

jorge@jorge-negra:/media/usb-drive$ ls
DSC01434.JPG  $RECYCLE.BIN  System Volume Information
 

jorge@jorge-negra:/media/usb-drive$ mount
/dev/sda6 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=jorge)
/dev/sdb1 on /media/usb-drive type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
 

jorge@jorge-negra:/media/usb-drive$ umount /media/usb-drive
umount: /media/usb-drive is not in the fstab (and you are not root)


jorge@jorge-negra:/media/usb-drive$ sudo umount /media/usb-drive
umount: /media/usb-drive: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
 

jorge@jorge-negra:/media/usb-drive$ sudo umount /media/usb-drive
umount: /media/usb-drive: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
 

jorge@jorge-negra:/media/usb-drive$ cd ~
 

jorge@jorge-negra:~$ sudo umount /media/usb-drive
 

jorge@jorge-negra:~$

Monday, April 6, 2020

Semana de Cuarentena

Domingo 5-Abril-2020

Pelicula: Un Dia Perfecto
   Where Have All The Flowers Gone? - The Kingston Trio

Pelicula: The Insult

Ambas me gustaron mucho

Lunes 6
Hasta que la muerte los juntó (This Is Where I Leave You)

Martes 7
El sol que abrasa

Miercoles 8

Jueves 9

Viernes 10

Sabado 11-Abril-2020
  • Cazando Salvajes
  • Poco Ortodoxa
  • One of us
Domingo 12-Abril-2020
  • Love,Wedding Repeat

Monday, December 17, 2018

Ejemplo de la operacion "element closest" en BLT

Fuente: https://www.tek-tips.com/viewthread.cfm?qid=503800
Adaptado para RBC.

package require rbc

rbc::vector create x(20)
rbc::vector create y(20)

x seq 1 20
y random

rbc::graph .g
pack .g -expand yes -fill both

.g element create data -xdata x -ydata y

toplevel .report -bg black
label .report.info -textvariable status -justify left -bg yellow
pack .report.info -padx 2 -pady 2

wm withdraw .report
wm overrideredirect .report 1

.g element bind data {
    if {[.g element closest %x %y click]} {
        set status "Clicked on \"$click(name)\" element\n"
        append status "Data point $click(index)\n"
        append status "x value: $click(x), y value $click(y)"
       
        wm geometry .report +%X+%Y
        wm deiconify .report
    }
}

.g element bind data {
    wm withdraw .report
}

Sunday, November 25, 2018

Galeria de Fotos

Instale' apache.

El contenido lo prepare' con 2 programas:
  1. https://wiki.tcl-lang.org/page/PhotoAlbum+-A+Web+Gallery+Creation+Tool
  2. https://wiki.tcl-lang.org/page/MajaMaja
Tuve 3 problemas:
1) MajaMaja no queria correr ya que se quejaba de la version de Itcl.
>>> Solo tuve que quitar la restriccion de version en el script.

2) Las Imagenes aparecen bien si abro el archivo index.html sin que intervenga el web server, pero aparecen "rotas" si las trato de accesar desde el navegador a traves de apache.
>>> Tuve que borrar "file:" del script, en la parte del atributo "src" de las imagenes.

3) Las Imagenes aparecen rotadas, aunque segun yo, las corrija con el editor de imagenes de MS.
>>> Tuve que editarlas con ImageMagick, el cual si las corrige realmente.

y listo !



Thursday, April 5, 2018

Sample Post

Title:

color code


😊


Martes 5 Abril 2018

Sunday, December 6, 2015

Modulo I2C para LCD y el PICkit Serial Analyzer

El diagrama del modulo "backpack":
                                     +
         1   2  3                    |
         +   +  +                    |
         |   |  |            +-------+-------+
         |   |  |            |       2       |
       +-+---+--+---+        |               |
     16| A0 A1 A2   |        |               |
+-------+V        P0+--------+4 RS          3+-----+
       |            |        |               |
       |          P1+--------+5 RW           |
     15|            |        |               |
+------+SDA       P2+--------+6 EN           |
       |            |        |               |
       | PCF8574  P3|        |    LCD        |
     14|            |        |               |
+------+SCL         |     DB4|               |
       |          P4+--------+11             |
       |            |     DB5|               |
     13|          P5+--------+12             |
+------+INT         |     DB6|               |
       |          P6+--------+13             |
       |            |     DB7|               |
       |          P7+--------+14             |
       |            |     DB3|               |
       |  8         |     +--+10             |
       +--+---------+     DB2|               |
          |               +--+9              |
          v               DB1|               |
                          +--+8              |
                          DB0|               |
                          +--+7      1       |
                             +-------+-------+
                                     |
                                     v

La interconexion entre el LCD y el PICkit serial analyzer:



La secuencia de inicializacion del LCD para 4 bits:

Escribir una "A" en el display:

Informacion de referencia:

La clave:
En mi caso, el ajuste del contraste me jugo' una mala pasada pues llegue' a pensar que estaba haciendo algo mal con la inicializacion a 4 bits, cuando, en realidad, solo faltaba ajustar el control de contraste en el modulo "backpack"

.

Saturday, August 29, 2015

command line screencast

mkcast
https://github.com/KeyboardFire/mkcast

doitlive
http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce/Run-Live-Presentations-in-Terminal-with-doitlive

El primero, graba la interaccion en la consola como un gif agregando una vista con caracteres grandes en la parte baja de la pantalla para mejorar la visibilidad de lo que se teclea.

El segundo, permite grabar una serie de comandos, para luego ser reproducidos al ritmo de teclear lo que sea, a la hora de la presentacion, lo que te hara' parecer un as del teclado.

Tuesday, November 4, 2014

El ultimo registro de TED

Ahora sé, cuando fué que se dañó mi modulo MTU de TED (The Energy Detective)


Links de interés:
http://scanlime.org/2008/09/measuring-energy-usage/
http://scanlime.org/2008/10/interfacing-with-the-energy-detective/
http://scanlime.org/2009/02/open-source-extra-sensitive-high-resolution-ted-receiver/

(a TED le sobreviven: El gateway y el display)

El reemplazo cuesta 44 Dlls, de modo que...lo dejamos para despues.


Sunday, November 2, 2014

Optimizar subrutinas con codigo comun

Observe el siguiente ejemplo:

Se trata de 2 subrutinas: "lcd_cmd" y "lcd_dat"

  • Del lado derecho esta el "ANTES", a la izquierda el "DESPUES"

  • Las dos rutinas son iguales entre las lineas 71-81 y 87-97 en el "ANTES"
  • Lo que se hizo es compartir esas secciones que son iguales y que la entrada por "lcd_cmd" se salte la parte diferente de "lcd_dat" (ve la etiqueta de dirección "codCom")
  • Observe que en el despues, hay una sola "salida" (comando "return")
  • El resultado es tener ~10 lineas menos de código y el consiguiente ahorro en memoria de programa, un recurso que en ocasiones es limitado y por lo tanto, muy apreciado.


Thursday, October 30, 2014

El misterio del comando SLEEP

Por alguna razón, el "sleep" ocasiona algo en el estado del microcontrolador, que hace que el programa ya no funcione al darle un "reset" al sistema.

  • Al final del programa (en lugar del SLEEP)dejé ciclado al micro, parpadeando RA6
  • RA1 parpadea con cada comando enviado al LCD
  • RA2 parpadea con cada dato enviado al LCD
  • Esas pausas adicionales creo hacen mas evidente la ejecucion del programa
  • Hay un error en el parametro de configuracion BOREN (yo puse BODEN ayer)

;
; LCD del picsim
;
; ZONA DE DATOS **********************************************************************

LIST P=16F628A
INCLUDE
__CONFIG   _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _BOREN_OFF & _LVP_OFF

CBLOCK 0x20
ctr
val
ENDC

; ZONA DE CÓDIGOS ********************************************************************
BANCO0 MACRO
BCF STATUS,RP0
BCF STATUS,RP1
ENDM
BANCO1 MACRO
BSF STATUS,RP0
BCF STATUS,RP1
ENDM
PUERTOS MACRO
BANCO1
CLRF VRCON
MOVLW H'30'
MOVWF TRISA
MOVLW H'E7'
MOVWF TRISB
BANCO0
MOVLW 7
MOVWF CMCON
CLRF PORTA
CLRF PORTB
ENDM

ORG 0
PUERTOS
call lcd_init

movlw H'4A'
movwf val
call lcd_dat
movlw H'4F'
movwf val
call lcd_dat
movlw H'52'
movwf val
call lcd_dat
movlw H'47'
movwf val
call lcd_dat
movlw H'45'
movwf val
call lcd_dat
fin
bsf PORTA,6
call Retardo_500ms
bcf PORTA,6
call Retardo_500ms
goto fin
; Inicializacion de LCD
lcd_init
bcf PORTA,0
bcf PORTB,3 ; 
call Retardo_20ms
bsf PORTA,0 ;
;
movlw H'30'
movwf val
call lcd_cmd
call Retardo_5ms
;
movlw H'30'
movwf val
call lcd_cmd
call Retardo_1ms
;
movlw H'38'
movwf val
call lcd_cmd
;
movlw H'08'
movwf val
call lcd_cmd
;
movlw H'0F'
movwf val
call lcd_cmd
;
movlw H'01'
movwf val
call lcd_cmd
;
movlw H'38'
movwf val
call lcd_cmd
;
movlw H'80'
movwf val
call lcd_cmd
 
return

; envia comando
lcd_cmd
bsf PORTA,0 ;
call lcd_wr ;
bcf PORTB,3
call Retardo_2ms
call Retardo_1ms
bcf PORTA,0
call Retardo_2ms
call Retardo_1ms
bsf PORTA,0
bsf PORTA,1
call Retardo_500ms
bcf PORTA,1
call Retardo_500ms
return
; envia dato
lcd_dat
bsf PORTA,0 ;
call lcd_wr ;
bsf PORTB,3
call Retardo_2ms
call Retardo_1ms
bcf PORTA,0
call Retardo_2ms
call Retardo_1ms
bsf PORTA,0
bsf PORTA,2
call Retardo_500ms
bcf PORTA,2
call Retardo_500ms
return
; escribe al LCD
lcd_wr ; 
bcf PORTB,4 ; 
movlw d'8' ; 
movwf ctr ;
again
btfsc val,7
goto envia1
bcf PORTB,3
goto rota
envia1
bsf PORTB,3 ; 
rota
rlf val,F
bsf PORTB,4 ; 
bcf PORTB,4 ; 
decfsz ctr,F ;
goto again
return

;
INCLUDE  
END

Wednesday, October 29, 2014

Ejemplo en PicSimLab

Escribiendo caracteres al LCD del picsim:



Al programa aun le falta compactar, o sea, poner ciclos donde hay codigo duplicado, etc.
El programa funciona y puede ser un buen punto de partida para explicar algunos conceptos.

En ensamblador:
; LCD del picsim
;
; ZONA DE DATOS **********************************************************************

LIST P=16F628A
INCLUDE
__CONFIG   _XT_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _BODEN_OFF & _LVP_OFF

CBLOCK 0x20
ctr
val
ENDC

; ZONA DE CÓDIGOS ********************************************************************
BANCO0 MACRO
BCF STATUS,RP0
BCF STATUS,RP1
ENDM
BANCO1 MACRO
BSF STATUS,RP0
BCF STATUS,RP1
ENDM
PUERTOS MACRO
BANCO1
CLRF VRCON
MOVLW H'1E'
MOVWF TRISA
CLRF TRISB
BANCO0
MOVLW 7
MOVWF CMCON
BCF PORTA,0
CLRF PORTB
ENDM

ORG 0
PUERTOS
call lcd_init
movlw H'4A'
movwf val
call lcd_dat
movlw H'4F'
movwf val
call lcd_dat
movlw H'52'
movwf val
call lcd_dat
movlw H'47'
movwf val
call lcd_dat
movlw H'45'
movwf val
call lcd_dat
sleep
lcd_init
bcf PORTA,0
bsf PORTB,3 ; 
call Retardo_20ms
bsf PORTA,0 ;
;
movlw H'30'
movwf val
call lcd_cmd
call Retardo_5ms
;
movlw H'30'
movwf val
call lcd_cmd
call Retardo_1ms
;
movlw H'38'
movwf val
call lcd_cmd
;
movlw H'08'
movwf val
call lcd_cmd
;
movlw H'0F'
movwf val
call lcd_cmd
;
movlw H'01'
movwf val
call lcd_cmd
;
movlw H'38'
movwf val
call lcd_cmd
return

; envia comando
lcd_cmd
bsf PORTA,0 ;
call lcd_wr ;
bcf PORTB,3
call Retardo_2ms
call Retardo_1ms
bcf PORTA,0
call Retardo_2ms
call Retardo_1ms
bsf PORTA,0
return
; envia dato
lcd_dat
bsf PORTA,0 ;
call lcd_wr ;
bsf PORTB,3
call Retardo_2ms
call Retardo_1ms
bcf PORTA,0
call Retardo_2ms
call Retardo_1ms
bsf PORTA,0
return
; escribe al LCD
lcd_wr ; 
bcf PORTB,4 ; 
movlw d'8' ; 
movwf ctr ;
again
btfsc val,7
goto envia1
bcf PORTB,3
goto rota
envia1
bsf PORTB,3 ; 
rota
rlf val
bsf PORTB,4 ; 
bcf PORTB,4 ; 
decfsz ctr,F ;
goto again
return

;
INCLUDE  
END

Friday, October 24, 2014

LCD 16x1 o 8x2 ???

A continuación se muestra (lado a lado), la modificación que tuve que hacerle al ejemplo de uso de puerto serie y display LCD 16x1 debido a la particularidad de éste, de tratar la única linea de 16 caracteres, como si fueran 2 lineas con 8 caracteres cada una.

El programa original, hecho para un display de 16x2, se comporta mostrando solo 8 caracteres, el noveno ya no se muestra...