sabato 12 settembre 2015

My PS3 seems to be dead. Long live to PS3

Some days ago, my children have problem with our PS3. They tried to restart the console but when the device restarted, an error message came up asking to check the storage. 
Obviusly we answered yes and we started to wait .... a long wait. .... long ...

The day after (yes this operation was very slow and was necessary one whole day) finally the check disk was finished but PS3 was telling us that the system was corrupted so we had to insert an USB stick with latest firmware.
No problem, we had it, so we inserted USB stick and reflash our PS3 (yes all games progress was lost). When flash process was finished we restarted the console and .... nothing happened on the screen.  The screen was blank.
We tried to start recovery console but nothing.  The screen still was blank.
We checked all connections: power cord, HDMI cord;but nothing, the screen still was blank.

Some days later I tried to remove the internal HD from PS3 and when I power on it an error screen came up on the screen. Wow, I thought, so no hardware problem on video card and motherboard, probably the problem is the communication with HardDisk.

In the office I had an 2.5" HD so I took it and when I come back at home I tried to insert in the PS3 and ... opla ... recovery console now came up.

Now with a new HD my PS3 is like new.

I can understand that HD is critical for console but Sony could simply show an error message on the screen. In this was we though that it was dead but that wasn't true.

venerdì 14 marzo 2014

NFS on LXC container

When I have two or more linux servers that need to share part of filesystem normally I use NFS.
But when the machine aren't real sometime wrong can happened.
Latest server that I had configurated are not real, but run on LXC linux container.

After several google search a lot of test finally I accepted the fact that NFS server on LXC is actually  not supported. So, what can I do?
Ok, if NFS server on LXC can't run I always try to run NFS server on real server and configure all the virtual machine as NFS client, so I try to do it.

Again, NFS client on LXC seems do not work. Why? The problem is apparmor on the real machine that block any appempt to mount NFS volumes.
In order to try to minimize the security changes on apparmor I add the following lines in /etc/apparmor.d/lxc/lxc-default


and now all run perfectly.

domenica 3 febbraio 2013

Modbus from C# - episode one - get a register value

Modbus is a protocol that allow to access data to a remote device.
Normally a modbus device is connected using serial line like RS232 or RS485 but ethernet is used also.

List of devices that support modbus protocol is very very long and you can find:

  • remote I/O interface
  • power meter
  • inverter
  • .... 
 Normally I used libmodbus library in order to access to modbus devices but this is a C library so why not write a wrapper to use libmodbus from my C# code?
Here you can find the result and below I present a first usage example where the fist 16 register are read from R/W modbus resgister:
using System;
using libmodbussharp;

namespace modbussharptutorial
{
 class MainClass
 {
  public static void Main (string[] args)
  {
   string modbusAddress = "127.0.0.1";
   int port = 1502;
   int sizeMapping = 512;
   bool debug = true;
   
   // Modbus Initialization 
   ModbusCore modbus = new ModbusCore(modbusAddress, port);
   modbus.Debug=debug;
   modbus.SetSlave (1);
   modbus.Connect();
      if (modbus.MappingNew(sizeMapping,sizeMapping,sizeMapping,sizeMapping)) {
    Console.WriteLine("Failed to allocate the mapping.");
          return;
      }

   // Ask for first 16 read/write registers
   modbus.RegistersRWRead (0, 16);
   
   // Print result to console
   for (int i=0; i < 16; ++i) {
    Console.WriteLine ("{0:X2} - {1:D}", i, modbus.RegisterRWUnsigned [i]);
   }
  }
 }
}

venerdì 25 marzo 2011

Linq on MonoDroid

I love this post so when it is possibile I modify the original source code on various environment.
I do it on GTK, Sugar (OLPC) and maemo.
Now I realize the same thing on Android platform using Monodroid.
Here there are the source code and screenshots follows:

giovedì 17 marzo 2011

PgDroid updated.

PgDroid, a software to access postgresql databases from android devices, is update in order to compile with MonoDroid preview 14.
Moreover the Npgsql postgresql driver is moved to a separate project file.
Now you can download the Npgsql postgresql driver for Android from here and use in your code without the necessity to get PgDroid code.
Any suggestions about how to improve PgDroid are welcomed.
Best Regards

venerdì 4 marzo 2011

PgDroid part 2, PostgreSQL db from Android device using Monodroid and Npgsql

News from PgDroid project: - it is possible write and executes a generic SQL query from the device. - "connection list" function is added. With this function you are able to see any database connection and, if you are connected as administrator, you are able to terminate it. In a future I hope that will be possible for database owner kill sessions to own database. The source code can be found here. Any suggestions will be appreciated.
  
 

mercoledì 2 febbraio 2011

PgDroid, access to PostgreSQL db from Android device using Monodroid and Npgsql

Finally PgDroid (PostgreSQL from Android), an application to test PostgreSQL db access from android device using Monodroid and Npgsql seems to work. Actually give me the list of Tables, Views, Indexes and Sequences of any postgresql DB. Next step are adding some "Administrative tool" and the capability for the user to write an own SQL command.

To do: - publish in an open repository - more useful functions - ......

Any suggestions will be appreciated.

Ops.... Some screenshot are needed: