Connecting a Current Cost Envi to Arduino

A lot has been said related to the Current Cost Envi, specially since i bought one in December 2010.

I had previously linked to a computer with the data cable which i bought to Current Cost through Amazon, but the greatest potential of this is using it without a computer. So in the past i programmed a Arduino with some code from Francesco and all went well.

Later i’ve started in January 2012 a Domotics project and the Arduino – Envi connection was deprecated, and ended up with the Envi connected to a Raspberry Pi through the USB Cable.

A lot of time passed and since i had shut down the rPi and the Domotics project, i ended up with the Envi on my desk only controlling the power and temperature on the console. A lot of things change since then: i was putting the data on Pachube back then, and the Internet of Things was something emerging.

So back to work: one Arduino Uno and a Ethernet Shield are flying around and i had to use it in some way. I have some free time in my holidays break so let’s put this working.  In a glimpse i tried to recover some of my notes, or even the arduino code, but didn’t find any. So i decided to rework everything again from scratch and document all this now.

For starting connecting the Envi to the Arduino. The Envi has a RJ45 like plug in the back which “spits” a formatted XML. So just to read this you can cut any network cable and connect the pin 4 to GND in the Arduino, and pin 8 to any digital pin. For my setup i used digital pin 4. The connections are like this:

So after making this connection you only have to read a nd put the values in someplace.

The plan by here is to put this online. Back then it was used Pachube. Since then Pachube seems to be renamed to Cosm, and now is Xively, a LogMeIn Service.

Seems the old API is still around. The Francesco code for the Arduino which i talked before seems that’s needs an update so it can be used in Arduino IDE 1.0.5 and with the Xively API.

I managed to adapt the code and will try to clean it up a bit. After that i will publish it in my GitHub, but my plan in not using Xively in the future, and use a self hosted database, to avoid api calls limit, and have a better history.

Codebits VI – 15 a 17 Novembro 2012

Começa amanhã a sexta edição deste evento que ano após ano concentra num único local uma grande parte dos adeptos tecnológicos do nosso país e muitos outros que adoram os temas technology related.

O ano passado foram 800 pessoas em modo non stop, três dias!

Foi a primeira vez que participei no evento, e adorei é apenas o que posso dizer.

Tinha planeado participar de forma a assistir ás interessantíssimas talks propostas, mas dei por mim embrenhado num projeto que começou com uma pequena brincadeira com um Arduino. E foi aí que nasceu o Home Automation

Não ganhámos nenhum prémio, aliás, a nossa apresentação em 90 segundos até foi fraquinha…. porque estávamos demasiado cansados, tivemos pouco tempo para preparar a apresentação, e sinceramente, o tema não causa o efeito WOW na plateia que vota. Mas foi com agrado que o nosso projeto foi seleccionado para participar no Sapo Codebits Labs este ano. A ideia era acelerar projetos e transformá-los em soluções comerciais.

Posso dizer que nem tudo correu como queria, sendo a falta de tempo uma grande condicionante, mas foram uns meses interessantes. Aprendemos muitas coisas ao longo deste ano, e acábamos por fazer um sistema de Domótica.

Não sei qual será o futuro deste sistema, talvez nos próximos tempos saibamos o rumo da coisa, mas por agora é efetivamente o sistema que equipa a minha casa, que acabou por servir de piloto de desenvolvimento.

Para este tracei como meta assistir mais ás talks. A direta o ano passado pesou-me no corpinho já nada habituado a estas coisas, e isso levou-me a este objetivo.

No entanto coisa puxa coisa, como adepto de tecnologia que sou, já tenho algumas ideias em mente. Vejamos se sai dali alguma coisa. Tal como o ano passado, a ideia é explorar um pouco e brincar. Se sair algo que possa ser interessante e apresentado como mini projeto perfeito!

E não…. não vai ser nada com o Raspberry Pi, que parece ir dominar o evento este ano. Porque isso para mim já não têm o fator WOW, porque em raspberry PI já mexo desde Junho, e posso adiantar que está bem estável, não estivesse ele ligado 24/7 e fosse o cérebro do sistema de domótica.

E pronto… amanhã lá começa! Amanhã temos ainda programado o jantar do Aberto até de Madrugada, com direito a dormida por casa ainda.

De Sexta para Sábado veremos o que acontece no Pavilhão Atlântico… o ano passado foi direta, por isso o melhor é dizer “nunca digas nunca”. Certo é que está garantido que vai ser um evento espetacular!

 

 

 

 

 

 

Missing PHP, found SimpleInvoices

Since last three years I’ve not playing around with PHP like i used to be.

The lack from anything objective to hack around or develop as new, resulting from a specific need has driven me to not to touch it.

I’m thrilled with a new project I’ve found – Simple Invoices.

Since this year I’m part of the condominium administration I’ve searched for a simple program to keep track of our invoices. It’s not a  lot of invoices to do, but if i can do it without a simple Microsoft Word document, and could do it using a program to manage it and eventually keep in track the bills and payments it’s a good use.

After a small market research I’ve elected some points which need to have fulfilled:

– It must be free

– It must be simple

– It must be web or in somehow portable as with the arrival of a new administration the decision to use it or not must be taken, and the program can be used it or not by others.

– It would be “nice to have” export to PDF and send by email, and maybe invoice recurrence

Well found the Simple Invoices !

Simple Invoices it’s simple:

Creating an invoice in Simple Invoices is as simple as selecting a biller, customer, enter a description and amount and click ‘Save Invoice’.

It is easy and fast.

It’s web based

Simple Invoices is a web based application. This means once you set it up you can then access and use Simple Invoices from any PC using a web browser, nothing to install on clients PCs.

Just open a web browser and go nuts creating invoices.

Has PDF feature

With a click of the mouse you can easily email an invoice as PDF to your clients through Simple Invoics

Well and for all this i’d like of what i saw. It’s a community project, easy hackable because it’s written in PHP, and you can always see what’s he doing by looking in the DB or code – no closed solutions.

I believe it’s not as good as a commercial one, but it’s free and simple. I believe also that it won’t met all sort of financial requirements, for example like SAFT-PT (Standard Audit File for Tax Purposes – Portuguese version) as other ones, but’s it’s very good for the job. I think you can manage to have SAFT-PT easily like as this example in softwarelivre.sapo.pt.

Other web examples are Invoice€xpress (paid), BambooVoice (free), and as standalone applications Primavera Express (free and Portuguese), Evaristo (a free Portuguese Java program), Time-Factura (free with MS-Access Database, and paid version with SQL), Invoy (for Mac and a small paid value) or Projecto Colibri free and paid also in Java. Many more should exist but these are the ones i’ve explored.

Team Foundation Server 2010 & Novos Conceitos

Tenho andado a explorar o Team Foundation Server, que é algo diferente do antigo Sourcesafe da Microsoft.

Além de mais evoluída esta ferramenta introduz (quer dizer… já não é nova, a novidade é mesmo entre o SourceSafe e o TFS…) alguns conceitos novos, e formas de funcionamento diferentes (muito).

Completo este pequeno artigo, com algumas imagens minhas e eventualmente alguns comentários também, e textos da WikiPedia. Não pretendo aprofundar muito, dado que defendo que a aprendizagem deve partir de cada um…. mas aborda-se aqui os conceitos que julgo importantes, e marcos da diferença entre os dois sistemas.

Team Foundation Server (commonly abbreviated to TFS)

is a Microsoft product offering source control, data collection, reporting, and project tracking, and is intended for collaborative software development projects. It is available either as stand-alone software, or as the server side back end platform for Visual Studio Team System (VSTS).

Team Foundation Server works in a three-tier architecture: the client tier, the application tier and the data tier. The client tier is used for creating and managing projects and accessing the items that are stored and managed for a project. TFS does not include any user interface for this tier, rather it exposes web services which client applications can use to integrate TFS functionality with themselves. These web services are used by applications like Visual Studio Team System to use TFS as data storage back end or dedicated TFS management applications like the included Team Foundation Client. The web services are in theapplication layer. The application layer also includes a web portal and a document repository facilitated by Windows SharePoint Services. The web portal, called the Team Project Portal, acts as the central point of communication for projects managed by TFS. The document repository is used for both project items and the revisions tracked, as well as for aggregated data and generated reports. The data layer, essentially an SQL Server 2005 Standard Edition installation, provides the persistent data storage services for the document repository. The data tier and application tier can exist on different physical or virtual servers as well, provided they are running Windows Server 2003 or better. The data tier is not exposed to the client tier, only the application tier is.

Podemos desde já através da suite VS contemplar bastantes diferenças nos produtos. Dado que a suite 2010 é visualmente bastante diferente da 2008 poderá ocasionar uma agradável lufada de ar fresco á vista…. ou simplesmente dar a ideia de uma cara lavada no Visual Studio. Não obstante tal, o que se quer aqui analizar é mesmo a integração com o Team Foundation Server.

Além do interface do Visual Studio, existe um frontendweb onde se podem fazer ainda várias operações… ora ao que li, pode ser integrado com SharePoint e Sql Server. Na minha versão foi instalado no modo básico, ligado a um Sql Express. Não deixam de ser no entanto interessantes as possibilidades.

Explorando um pouco o interface no Visual Studio,  especialmente para quem apenas está habituado ao Check Out & Check In  verificam-se a existÊncia de novos conceitos. Vamos então ver um pouco deles com a ajuda da nossa bela Wikipedia.

Source control e o mecanismo de repositório de informação.

Team Foundation Server provides a source control repository, called Team Foundation Version Control (TFVC). Unlike Microsoft’s previous source control offering, Visual SourceSafe (VSS), which relied on a file-based storage mechanism, Team Foundation source control stores all code, as well as a record of all changes and current check-outs in a SQL Server database.

Shelving / Unshelving

It supports features such as multiple simultaneous check-outs, conflict resolution, shelving and unshelving (shelving is a way to save a set of pending changes without committing them to source control, while still making them available to other users), branching and merging, and the ability to set security levels on any level of a source tree, alongside the most visible features of document versioning, locking, rollback, and atomic commits. The source control mechanism integrates with Team System’s work items as well; when a check-in (termed “changeset”) occurs, a developer can choose to have his code associated with one or more specific work items, to indicate that the check-in works towards solving specific issues. TFS administrators can enforce check-in policies that require Code Analysis requirements to have passed, as well as to enforce the association of check-ins with work items, or update the state of associated work items (like flagging a bug as “fixed” when checking in code that has the bug fixed). Individual versions of files can be assigned labels, and all files with the same label forms a release group. Unlike VSS, TFS source control repository does not support linking to an item from multiple places in the source folder structure, nor does it allow an item to be “pinned” (allow different references to the same file from different directories to point to different versions in a way that cannot be further edited).

Branching & Merging

TFVC supports branching at entire source code level as well as individual files and directory levels, with each branch being maintained individually. Multiple branches can be merged together, with the built in conflict resolution algorithm merging the changes between two branches of the same file where it can automatically reconcile the differences or flagging them for manual inspection if it cannot. Merge can be performed at “changeset” level as well, instead of the branch level. A successful merge is automatically checked out in the source control repository.

TFVC is not limited to source code only, but using the Windows SharePoint Services infrastructure it is built on, it provides a version-controlled library for other documents in the project as well, including project plans, requirements and feature analysis documents among others. All documents in the source controlled repository can be linked with any work item, and access to them can be controlled by defining access policies.

Outros links interessantes:

Team Foundation Server Concepts on MSDN

Team Foundation Server 2010 Key Concepts

Understanding the Check-out and Check-in Concepts in Source Control Systems

Visual Studio 2010

Saiu no dia 12 de Abril o Visual Studio 2010 , pelo que neste momento, para quem usa não deve ser novidade, mas fica a minha nota.

A nova versão deste poderoso IDE vÊ assim a luz do dia, após uns betas com muitos bugs, mas muitas funcionalidades novas segundo dizem.

New and enhanced features in Visual Studio 2010 help you unleash your creativity. Customise your workspace with multiple monitor support. Create rich applications for SharePoint and the Web. Eliminate the dreaded “no repro” problem with IntelliTrace. Develop for a wide range of .NET Framework versions with precise multi-targeting.

É o lançamento da framework .Net 4.0. Abaixo uma breve descrição retirada da WikiPedia

The Visual Studio 2010 IDE has been redesigned which, according to Microsoft, clears the UI organization and “reduces clutter and complexity.”[71] The new IDE better supports multiple document windows and floating tool windows,[71] while offering better multi-monitor support. The IDE shell has been rewritten using the Windows Presentation Foundation (WPF),[72] whereas the internals have been redesigned using Managed Extensibility Framework (MEF) that offers more extensibility points than previous versions of the IDE that enabled add-ins to modify the behavior of the IDE.[73] The new multi-paradigm programming language ML-variant F# is part of Visual Studio 2010;[74] as is M, the textual modeling language, and Quadrant, the visual model designer, which are a part of the Oslo initiative.[75]

Visual Studio 2010 comes with .NET Framework 4 and supports developing applications targeting Windows 7.[71] It supports IBM DB2 and Oracle databases for more information, in addition to Microsoft SQL Server.[71] It has integrated support for developing Microsoft Silverlight applications, including an interactive designer.[71] Visual Studio 2010 offers several tools to make parallel programming simpler: in addition to the Parallel Extensions for the .NET Framework and the Parallel Patterns Library for native code, Visual Studio 2010 includes tools for debugging parallel applications. The new tools let parallel Tasks and their runtime stacks to be visualized.[76] Tools for profiling parallel applications can be used for visualization of thread wait times and thread migrations across processor cores.[77] Intel and Microsoft have jointly pledged support for a new Concurrency Runtime in Visual Studio 2010[78] and Intel has launched parallelism support in Parallel Studio as an add-on for Visual Studio.[79]

The Visual Studio 2010 code editor now highlights references; whenever a symbol is selected, all other usages of the symbol are highlighted.[80] It also offers a Quick Search feature to incrementally search across all symbols in C++, C# and VB.NET projects. Quick Search supports substring matches and camelCase searches.[80] The Call Hierarchy feature allows the developer to see all the methods that are called from a current method as well as the methods that call the current one.[80] IntelliSense in Visual Studio supports a consume-first mode, which can be opted-into by the developer. In this mode, IntelliSense will not auto-complete identifiers; this allows the developer to use undefined identifiers (like variable or method names) and define those later. Visual Studio 2010 can also help in this by automatically defining them, if it can infer their types from usage.

Parece-me na minha humilde opinião que cada vez trás mais coisas, e demora mais tempo a instalar… cerca de 2 GB no disco após um full install.

Em compensação o UI é bastante agradável e fluido…. Bem mais agradável que o o do VS 2008

E para finalizar, a minha primeira app feita no IDE 😉 – um simples Hello World em C#

Muito potencial concerteza, de certo pelos meus lados nunca o utilizarei todo nem muito menos irei necessitar ou compreender, mas é de certo uma milestone. Pronto… e agora já se pode então fazer umas coisas em WCF com a nova framework… veremos ! 🙂