February 23, 2018

Sample code to reach registers on Schneider IEM3355 Modbus energy meter

Although registers are well documented, I was unsuccessful using pymodbus3 and my own C client to read modbus data. Finally a stable version in perl:


use Device::Modbus::RTU::Client;
use warnings;
use Data::Dumper;

my $client = Device::Modbus::RTU::Client->new(
port => '/dev/ttyUSB0',
baudrate => 38400,
parity => 'even',
);

sub read_string
#where:as in the documentation
{
$where= shift;
$length = shift;

my $req = $client->read_holding_registers(
unit => 3, #might be different for you!
address => $where-1, #although it is 30 in doc, it is 29 in reality
quantity => $length,
);

$client->send_request($req);
my $resp = $client->receive_response;
#printf(Dumper($resp));
my $t=$resp->values;
$i=0;
$s="";

while ($i<$length) { $s.=chr($t->[$i]/256);
$s.=chr($t->[$i]%256);
$i++;
}
#printf("$s\n");
return $s;

}

printf("name:".read_string(30,20)."\n");
printf("model:".read_string(50,20)."\n");
printf("manufacturer:".read_string(70,20)."\n");

$client->disconnect;


boldi@supercell$ perl arammero.pl
name:Energy Meter
model:iEM3355
manufacturer:Schneider Electric

edit no. 4: I'm github publisher right now. I have to update my CV with new skills.
https://github.com/bbencsath/schneider_iem3355_modbus_client/blob/master/code/sample_client.pl

February 19, 2018

8fa14cdd754f91cc6554c9e71929cce7
ff1ccf57e98c817df1efcd9fe44a8aeb
e680afd37e4511a8cb3ce9f63168862a
30baf0837b1972f86bc7492024cef370
933dd8674c563081260867dfa95b5e74
c47d187067c6cf953245f128b5fde62a
23a58bf9274bedb19375e527a0744fa9
584826e70485130530f7f01a973d5637
0800fc577294c34e0b28ad2839435945
94ba2f131d2123c74c1b72a82ecefbc5
21582c6c30be1217322cdb9aebaf4a59
e680afd37e4511a8cb3ce9f63168862a
099dafc678df7d266c25f95ccf6cde22
03d59e663c1af9ac33a9949d1193505a
70a17ffa722a3985b86d30b034ad06d7
e81c4e4f2b7b93b481e13a8553c2ae1b
b5efd87626ed3cac81251fd32da830db
13b5bfe96f3e2fe411c9f66f4a582adf
8fc42c6ddf9966db3b09e84365034357
8512ae7d57b1396273f76fe6ed341a23
2a6a84e9e44441afbd75cc19ce28be37
a181a603769c1f98ad927e7367c7aa51
89759e1284e2479b991d2669de104942
e680afd37e4511a8cb3ce9f63168862a
910955a907e739b81ec8855763108a29
8fc42c6ddf9966db3b09e84365034357
51037a4a37730f52c8732586d3aaa316
f7bd60b75b29d79b660a2859395c1a24
37598dad8f8805ce708ba8c4f67ce367
e680afd37e4511a8cb3ce9f63168862a
910955a907e739b81ec8855763108a29
9be7a023323b5e7da39b5c68d986c4d0
7c2310f49b45203bf5e4ddc2a12c94da
72992fb088bfa63dcb49ef663fcdfe53

February 2, 2018

hehe

job62549

January 9, 2018

ikea metod szintkulonbseg

Ikea meth0d kONYHA WEDDDINGE előlapokkal. elkezdedd felreszerelni. a sín sínes-rész két féle, az alsó szinten a sín az alsó pöttyökbe ér be, a fölötte levő szinteket a felső pöttyökbe, felső szintekbe szintbe kell berakni. Mégis, nem működik a cucc, mert valami nem stimmel.
a trükk, hogy az előlap vasának nem 2 hanem 3 lyuka van. Ha figyepmessen megnézed, az előlap vasán 3 lyuk és két furat van. az egy az fura vas idom. Könnyű elnézni és simán vemmi.

December 23, 2017

etdr

Server Error in ‘/’ Application.
could not load an entity: [Common.Entities.BusinessEntities.ProcessEntities.Process#474172][SQL: SELECT process0_.Id as Id69_2_, process0_.Version as Version69_2_, process0_.IsDeleted as IsDeleted69_2_, process0_.DisplayName as DisplayN4_69_2_, process0_.ProcessNumber as ProcessN5_69_2_, process0_.ProcessName as ProcessN6_69_2_, process0_.Note as Note69_2_, process0_.CreationTime as Creation8_69_2_, process0_.SubmissionDate as Submissi9_69_2_, process0_.ShowInGeneralInformations as ShowInG10_69_2_, process0_.StartType as StartType69_2_, process0_.EpitesiTevekenyseg as Epitesi12_69_2_, process0_.ShortDescription as ShortDe13_69_2_, process0_.AbberationNecessity as Abberat14_69_2_, process0_.ClerkTimeInDays as ClerkTi15_69_2_, process0_.DocumentSvcWarningSent as Documen16_69_2_, process0_.Ngsz as Ngsz69_2_, process0_.NgszJogszabaly as NgszJog18_69_2_, process0_.Classified as Classified69_2_, process0_.CreationState as Creatio20_69_2_, process0_.NotificationEmail as Notific21_69_2_, process0_.SzamitottEpitmenyErtek as Szamito22_69_2_, process0_.IsPublicFundUsed as IsPubli23_69_2_, process0_.MainProcessTypeId as MainPro24_69_2_, process0_.ExtractSubjectEstateId as Extract25_69_2_, process0_.CreatorUserId as Creator26_69_2_, process0_.ActingOfficeId as ActingO27_69_2_, process0_.ApplicantId as Applica28_69_2_, process0_.Stat_1076Id as Stat29_69_2_, process0_.Stat_1078Id as Stat30_69_2_, process0_.Stat_1081Id as Stat31_69_2_, (select count(*) from Document where Document.ProcessId = process0_.Id and Document.IsDeleted = 0) as formula1_2_, buildings1_.ProcessId as ProcessId4_, buildings1_.Id as Id4_, buildings1_.Id as Id96_0_, buildings1_.CalculatedValue as Calculat2_96_0_, buildings1_.ContainsOtherFunctions as Contains3_96_0_, buildings1_.ProcessId as ProcessId96_0_, processadd2_.Id as Id66_1_, processadd2_.Version as Version66_1_, processadd2_.IsDeleted as IsDeleted66_1_, processadd2_.StartDate as StartDate66_1_, processadd2_.AdministrationDays as Administ5_66_1_, processadd2_.Deadline as Deadline66_1_, processadd2_.State as State66_1_, processadd2_.ProcessId as ProcessId66_1_ FROM [Process] process0_ left outer join [Building] buildings1_ on process0_.Id=buildings1_.ProcessId left outer join [ProcessAdditionalDataUser] processadd2_ on process0_.Id=processadd2_.ProcessId WHERE process0_.Id=?]
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: could not load an entity: [Common.Entities.BusinessEntities.ProcessEntities.Process#474172][SQL: SELECT process0_.Id as Id69_2_, process0_.Version as Version69_2_, process0_.IsDeleted as IsDeleted69_2_, process0_.DisplayName as DisplayN4_69_2_, process0_.ProcessNumber as ProcessN5_69_2_, process0_.ProcessName as ProcessN6_69_2_, process0_.Note as Note69_2_, process0_.CreationTime as Creation8_69_2_, process0_.SubmissionDate as Submissi9_69_2_, process0_.ShowInGeneralInformations as ShowInG10_69_2_, process0_.StartType as StartType69_2_, process0_.EpitesiTevekenyseg as Epitesi12_69_2_, process0_.ShortDescription as ShortDe13_69_2_, process0_.AbberationNecessity as Abberat14_69_2_, process0_.ClerkTimeInDays as ClerkTi15_69_2_, process0_.DocumentSvcWarningSent as Documen16_69_2_, process0_.Ngsz as Ngsz69_2_, process0_.NgszJogszabaly as NgszJog18_69_2_, process0_.Classified as Classified69_2_, process0_.CreationState as Creatio20_69_2_, process0_.NotificationEmail as Notific21_69_2_, process0_.SzamitottEpitmenyErtek as Szamito22_69_2_, process0_.IsPublicFundUsed as IsPubli23_69_2_, process0_.MainProcessTypeId as MainPro24_69_2_, process0_.ExtractSubjectEstateId as Extract25_69_2_, process0_.CreatorUserId as Creator26_69_2_, process0_.ActingOfficeId as ActingO27_69_2_, process0_.ApplicantId as Applica28_69_2_, process0_.Stat_1076Id as Stat29_69_2_, process0_.Stat_1078Id as Stat30_69_2_, process0_.Stat_1081Id as Stat31_69_2_, (select count(*) from Document where Document.ProcessId = process0_.Id and Document.IsDeleted = 0) as formula1_2_, buildings1_.ProcessId as ProcessId4_, buildings1_.Id as Id4_, buildings1_.Id as Id96_0_, buildings1_.CalculatedValue as Calculat2_96_0_, buildings1_.ContainsOtherFunctions as Contains3_96_0_, buildings1_.ProcessId as ProcessId96_0_, processadd2_.Id as Id66_1_, processadd2_.Version as Version66_1_, processadd2_.IsDeleted as IsDeleted66_1_, processadd2_.StartDate as StartDate66_1_, processadd2_.AdministrationDays as Administ5_66_1_, processadd2_.Deadline as Deadline66_1_, processadd2_.State as State66_1_, processadd2_.ProcessId as ProcessId66_1_ FROM [Process] process0_ left outer join [Building] buildings1_ on process0_.Id=buildings1_.ProcessId left outer join [ProcessAdditionalDataUser] processadd2_ on process0_.Id=processadd2_.ProcessId WHERE process0_.Id=?]

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FaultException`1: could not load an entity: [Common.Entities.BusinessEntities.ProcessEntities.Process#474172][SQL: SELECT process0_.Id as Id69_2_, process0_.Version as Version69_2_, process0_.IsDeleted as IsDeleted69_2_, process0_.DisplayName as DisplayN4_69_2_, process0_.ProcessNumber as ProcessN5_69_2_, process0_.ProcessName as ProcessN6_69_2_, process0_.Note as Note69_2_, process0_.CreationTime as Creation8_69_2_, process0_.SubmissionDate as Submissi9_69_2_, process0_.ShowInGeneralInformations as ShowInG10_69_2_, process0_.StartType as StartType69_2_, process0_.EpitesiTevekenyseg as Epitesi12_69_2_, process0_.ShortDescription as ShortDe13_69_2_, process0_.AbberationNecessity as Abberat14_69_2_, process0_.ClerkTimeInDays as ClerkTi15_69_2_, process0_.DocumentSvcWarningSent as Documen16_69_2_, process0_.Ngsz as Ngsz69_2_, process0_.NgszJogszabaly as NgszJog18_69_2_, process0_.Classified as Classified69_2_, process0_.CreationState as Creatio20_69_2_, process0_.NotificationEmail as Notific21_69_2_, process0_.SzamitottEpitmenyErtek as Szamito22_69_2_, process0_.IsPublicFundUsed as IsPubli23_69_2_, process0_.MainProcessTypeId as MainPro24_69_2_, process0_.ExtractSubjectEstateId as Extract25_69_2_, process0_.CreatorUserId as Creator26_69_2_, process0_.ActingOfficeId as ActingO27_69_2_, process0_.ApplicantId as Applica28_69_2_, process0_.Stat_1076Id as Stat29_69_2_, process0_.Stat_1078Id as Stat30_69_2_, process0_.Stat_1081Id as Stat31_69_2_, (select count(*) from Document where Document.ProcessId = process0_.Id and Document.IsDeleted = 0) as formula1_2_, buildings1_.ProcessId as ProcessId4_, buildings1_.Id as Id4_, buildings1_.Id as Id96_0_, buildings1_.CalculatedValue as Calculat2_96_0_, buildings1_.ContainsOtherFunctions as Contains3_96_0_, buildings1_.ProcessId as ProcessId96_0_, processadd2_.Id as Id66_1_, processadd2_.Version as Version66_1_, processadd2_.IsDeleted as IsDeleted66_1_, processadd2_.StartDate as StartDate66_1_, processadd2_.AdministrationDays as Administ5_66_1_, processadd2_.Deadline as Deadline66_1_, processadd2_.State as State66_1_, processadd2_.ProcessId as ProcessId66_1_ FROM [Process] process0_ left outer join [Building] buildings1_ on process0_.Id=buildings1_.ProcessId left outer join [ProcessAdditionalDataUser] processadd2_ on process0_.Id=processadd2_.ProcessId WHERE process0_.Id=?]]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14866482
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1321
EpHat.Shared.Contracts.QueryService.IQueryServiceClassifiedProcessChecker.GetProcessClassifiedStatus(Int32 entityId, EntityType entityType, Int32 userId) +0
EpHat.Controllers.<>c__DisplayClass7_0.b__0(IQueryService svc) +98
EpHat.Shared.WCF.WcfClient.UsingService(ChannelFactory`1 factory, Func`2 func, ServiceRequestHeader header) +790
EpHat.Shared.WCF.WcfClient.UsingQueryService(Func`2 func, ServiceRequestHeader header) +148
EpHat.Controllers.RDProcessByUserController.ProcessEdit(Int32 id, String activeTabName, Int32 userIdForProcessAdditionalData) +1058
lambda_method(Closure , ControllerBase , Object[] ) +247
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +280
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
System.Web.Mvc.Async.<>c__DisplayClass42.b__41() +33
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass39.b__33() +80
System.Web.Mvc.Async.<>c__DisplayClass4f.b__49() +385
System.Web.Mvc.Async.<>c__DisplayClass4f.b__49() +385
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass2a.b__20() +32
System.Web.Mvc.Async.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) +184
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.<>c__DisplayClass1d.b__18(IAsyncResult asyncResult) +27
System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +22
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +22
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.<>c__DisplayClass8.b__3(IAsyncResult asyncResult) +41
System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +607
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134

August 6, 2017

what to do with hot peppers?

In the last weeks we could pick quite an amount of hot peppers (chili) from our first harvest. Only two types, one is a jalapeno, the other is a typical long chili like ring of fire, but as the origin is from years, we just call it window chili, reflecting the plant that was sitting in the window for years.
So what to do with the harvest. For window chili we made some rings for drying, but for jalapeno we tried to make some vinegar chili.

The important thing is the amounts. so mine is currently: 1000 ml water, 100 ml vinegar 20% 55g salt 30g sugar (might be much more, like 110g), koriander seeds, mustar seeds. I started to boil without vinegar and as boiling, cut the fire and added vinegar.
the idea is ~2.5% salt level, not much bigger sugar content.

After cutting the heat I added the paprika/pepper then waited at least 5 minutes, then put peppers in the jar and juice. Used some salycilic acid to be sure it does not get rotten, especially I do not make the traditional long run heat-down method.

The important recipe that should be available whenever look back on this:
I used 1l – 1000g water
100 g 20% vinegar (acetic acid) coming to ~2,3% at the end
55g salt
30g sugar (some recipes say you can use 2x as salt, like 110)
some coriander and mustard seeds

June 24, 2017

Grillsajt sütése grillserpenyőben

Hosszú ideig bénáztam a sima főzőlapra való öntöttvas grillserpenyőmmel. Az első és legfontosabb gond az volt, hogy túlhevítettem. Nem 9-es, hanem kb. 6-os fokozaton kell használni. Van infravörös hőmérőm, ma már mindig azzal nézem be, hogy 150-200 fok között sütögessek, 200 fokot jó elérni, de nem érdemes nagyon meghaladni.
A grillsajttal (Hajdú pl.) meg az volt a gond, hogy felszeleteltem és szétesett két-három darabra a szelet.

Az új módszerem a következő. Felrakom az egész darab sajtot egyben a grillre és a két oldalát úgy 2×2-3 percig sütöm.
Ekkor leszedem és felszeletelem. A szeletek ekkor már nem esnek szét, mert nem ridegek, kicsit megolvadnak. A felszeletelt darabokat felrakom, megsütöm kb. 3 perc alatt és kész.
Nincs szétesés, nincs alulsütés, nincs semmi, csak tök jó sajt.

May 9, 2017

KRESZ táblák lényeges jogszabályai

KRESZ
https://net.jogtar.hu/jr/gen/hjegy_doc.cgi?docid=97500001.KPM

83/2004. (VI. 4.) GKM rendelet
a közúti jelzőtáblák megtervezésének, alkalmazásának és elhelyezésének követelményeiről
https://net.jogtar.hu/jr/gen/hjegy_doc.cgi?docid=a0400083.gkm

11/2001. (III. 13.) KöViM rendelet
az útburkolati jelek tervezési és létesítési előírásairól
https://net.jogtar.hu/jr/gen/hjegy_doc.cgi?docid=a0100011.kov

4/2001. (I. 31.) KöViM rendelet
a közúti jelzőtáblák méreteiről és műszaki követelményeiről
https://net.jogtar.hu/jr/gen/hjegy_doc.cgi?docid=a0100004.kov

May 8, 2017

Adding staple command to existing postscript file to stitch print on Xerox Workcentre

I had to print a number of jobs on a Xerox Workcentre with staple on them, printing automatically on linux with the lpr tool. Origin: latex -> dvi -> postscript. Printing is fine, but without a staple.

I’ve checked the data transferred from a windows print and from that I got the needed options for the postscript file. I created a short perl script that reads the original postscript output of dvips and adds the stapling option into the postscript file directly. Output then can be sent to lpr.

Here is the script, I hope special characters are o.k.:

$f=$ARGV[0];
$staple="%%BeginSetup
%%BeginFeature: *Stapling Single-Portrait
<< /Staple 3 /StapleDetails << /Type 1 /StapleLocation (SinglePortrait) >> >> setpagedevice
%%EndFeature
";

open(F2,$f) or die();
while ($s=<F2>)
{

if ($s=~ /^%%BeginSetup$/)
{
printf("%s",$staple);
}
else {printf("%s",$s);
}

}
fclose(F2);

February 20, 2017

Jázmin rizs

Eddig kb. vagy az AAA Lotus Thai Jasmine rizst használtuk vagy Golden Lotust, ami nagyon aromás. (hogy melyiket, az rejtély, most tuti AAA Lotust vettünk). A Panda brand bogárfertőzött volt. Most egy kilós TTR THu Thai Rice-t próbáltunk. Ez picit talán keményebbre főtt, pergősebb és fogkeményebb, jó az állaga, viszont kevésbé aromás. Egyelőre ennyi, folytatni kell majd a naplózást amikor a többit kipróbáljuk. Köszönöm a rizsfőzőt Thongnak…