Git Product home page Git Product logo

Comments (34)

ThomasDeutsch avatar ThomasDeutsch commented on July 22, 2024 1

Thank you!

I would like to help People to get the npm install working. Here are the steps it took.

Install:

  • Python 2.7.3 ( http://www.python.org/getit/releases/2.7.3/ )
  • Visual Studio Express 2010 32 bit ( make sure you have the C++ dependencies checked)
  • get node.js ( 32 bit - i never got it working for the x64 .... maybe you need the x64 VS2010 for that)
  • npm install -g node-gyp ( this will install node-gyp globally)

Configuration:

  • set PATH=%PATH%;C:\Python27 ( open cmd und type that in )

run "npm install johnny-five" from the project folder - DONE

i am not sure about the 32-64-bit part. can anyone confirm that?
Here you can set the compiler to 64-bit:
http://msdn.microsoft.com/en-us/library/x4d2c09s(v=vs.80).aspx
but i think you need to have Visual Studio 64 installed?! can anyone confirm?
i could not activate the 64-bit compiler and i have the 32-bit version installed.

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

The latest Serialport supports Windows com ports however Johnny-Five has never been tested on Windows (that I know of). At this point I can say confidently that even if it had installed, it still wouldn't work because Johnny-Five's serial port detection only looks in /dev/.

I dont have a Windows machine at my disposal to do the work required to support the OS.

Sorry :(

from johnny-five.

ThomasDeutsch avatar ThomasDeutsch commented on July 22, 2024

Ok, i think it is time for the Virtual Mashine now.
Thank you for your quick reply.

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

I know it's a pain in the ass, but I'd like to encourage you to try and contribute the support for windows :)

from johnny-five.

ThomasDeutsch avatar ThomasDeutsch commented on July 22, 2024

I will have a look into it.

2012/8/8 Rick Waldron [email protected]

I know it's a pain in the ass, but I'd like to encourage you to try and
contribute the support for windows :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-7597282.

from johnny-five.

dcherman avatar dcherman commented on July 22, 2024

CC Myself

FWIW I was able to get this installed with a simple npm install and have this working to a point, but firmata seems to hang on trying to connect, spitting back data endlessly. Added onto the Win7 support issue at firmata/firmata.js#7

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

Really appreciate all the windows platform contributions (even if they're bug reports!)

:)

from johnny-five.

Jellyfrog avatar Jellyfrog commented on July 22, 2024

Try newest node (0.8) and newest npm

But it seems like you don't have python in your path: "Can't find Python executable "python", you can set
the PYTHON env variable."

Try this:
http://docs.python.org/using/windows.html#excursus-setting-environment-variables

from johnny-five.

ThomasDeutsch avatar ThomasDeutsch commented on July 22, 2024

I had Python 3.x installed. I needed Python 2.7.
Also my Visual Studio installation had no c++ builder - i am a c# developer and never thought i need that.

Set my env.-variable: PATH=%PATH%;C:\Python27

npm install johnny-five was no problem than ... everything installed correctly.
The only Problem is this: firmata/firmata.js#7

Well... and then we need to work on hat "/dev/..." in the johnny-five code.
Windows will only reference a port like "COM3".

from johnny-five.

dcherman avatar dcherman commented on July 22, 2024

@ThomasDeutsch It's not too bad actually, the changes are pretty small.

Rather than using the current grep comment, my approach so far has been either

  • enumerate the registry with reg query ( but that requires admin rights ),
  • use powershell ( cmd: powershell [System.IO.Ports.SerialPort]::getportnames() )
  • WQL query

Powershell right now is my preferred approach I think as it's simple, doesn't seem to require admin privs, and spits out the exact output that's needed. Once firmata is working on Windows properly, I'll be able to do some more testing.

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

Are the windows port names always one of "COMn" where "n" is a number?

from johnny-five.

ThomasDeutsch avatar ThomasDeutsch commented on July 22, 2024

I think this is node-serialport specific.
In my case it is always COMn.

I think serialport got that feature from serial-port2.
In the SerialPort2 doc i can find this:
portName - The name of the port to open. Example: Windows 'COM1', Linux '/dev/ttyUSB0'.

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

Yes, @voodootikigod and @joeferner combined Serialport and Serialport2. We're thinking the same way—I asked about COMn b/c I saw the same reference as you... I think we're onto something :)

Can we try to guess the COMm?

from johnny-five.

voodootikigod avatar voodootikigod commented on July 22, 2024

you can use Windows Device Manager to identify the COMn values.

from johnny-five.

voodootikigod avatar voodootikigod commented on July 22, 2024

I am confused about what the final issue is here, i feel like there are 8 different ones interleaved, what is still an issue ATM? Happy to help.

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

@voodootikigod it's all good :)

Johnny-Five does port detection for you, so we're brainstorming how to make it work on windows. @ThomasDeutsch @Jellyfrog @dcherman are working out implementation details :)

from johnny-five.

voodootikigod avatar voodootikigod commented on July 22, 2024

Good luck on that, my response would be "Just use device manager".

On Monday, August 13, 2012 at 11:34 AM, Rick Waldron wrote:

@voodootikigod (https://github.com/voodootikigod) it's all good :)
Johnny-Five does port detection for you, so we're brainstorming how to make it work on windows. @ThomasDeutsch (https://github.com/ThomasDeutsch) @Jellyfrog (https://github.com/Jellyfrog) @dcherman (https://github.com/dcherman) are working out implementation details :)


Reply to this email directly or view it on GitHub (#48 (comment)).

from johnny-five.

joeferner avatar joeferner commented on July 22, 2024

If you need a list of open ports you can use the serialport.list function. I updated the readme over on serialport with an example. On windows it will give you COM1, COM2, etc. On linux/osx it'll give you /dev/ttyUSB0 or whatever.

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

Super helpful, thanks!

from johnny-five.

ThomasDeutsch avatar ThomasDeutsch commented on July 22, 2024

You can find this in the serialport code:
https://github.com/voodootikigod/node-serialport/blob/master/bin/serialportList.js

var serialport = require('../');
var sf = require('sf');

serialport.list(function (err, results) {
if (err) {
throw err;
}

for (var i = 0; i < results.length; i++) {
var item = results[i];
console.log(sf('{comName,-15} {pnpId,-20} {manufacturer}', item));
}
});

but i always got an error from serialport.list ?! ... anyone got this working with windows?

from johnny-five.

dcherman avatar dcherman commented on July 22, 2024

Yep, just tried serialport.list and it works beautifully. I'll try replacing the detection logic with serialport.list later tonight or tomorrow and see what happens.

from johnny-five.

ThomasDeutsch avatar ThomasDeutsch commented on July 22, 2024

Firmata should work now, too.
Big thanks to jgautier!
firmata/firmata.js#7 (comment)

There was also a problem with node-gyp today..... this was fixed too.
nodejs/node-gyp#122 (comment)

from johnny-five.

dcherman avatar dcherman commented on July 22, 2024

I filed a couple new issues related to Windows since this issue is really related to just getting johnny-five installed via npm

#55
#54

I did get a basic blink app running last night though, so that's a good sign

from johnny-five.

tehknox avatar tehknox commented on July 22, 2024

Got it working with :

  • nodejs 0.8.16
  • Python 2.7.3
  • Visual Studio 2010

Going to look further to see what might be the problem with the newer versions of Nodejs.

from johnny-five.

Alexaas avatar Alexaas commented on July 22, 2024

Hi, I have problems installing it on Win 8.1 with VS Express 2015. I get a lot of build errors during installation. Any idea what this could be?
Btw. what is ment by "make sure you have the C++ dependencies checked" ??

from johnny-five.

fivdi avatar fivdi commented on July 22, 2024

Hi, I have problems installing it on Win 8.1 with VS Express 2015. I get a lot of build errors during installation. Any idea what this could be?

@Alexaas what version on Node.js is being used? If it's Node.js 4.x, the build errors are likely to be related to serialport which is in the process of being upgraded to support Node.js 4. If this is the case, see serialport/node-serialport#578 for further details.

Btw. what is ment by "make sure you have the C++ dependencies checked" ??

Not sure, but would guess that it meant that a checkbox needed to be checked during the VS2010 install process.

from johnny-five.

AlexDmr avatar AlexDmr commented on July 22, 2024

Same situation with windows 10 and VS Express 2015, NodeJS 4.1.1.
Here are the erros 👍 enumser.cpp
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(263): error
C2995: 'v8::Local _NanEnsureLocal(v8::Local)' : function template has already been defined (..\src\serialport.cpp
) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(25
6) : see declaration of '_NanEnsureLocal'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C3083: 'smalloc': the symbol to the left of a '::' must be a type (..\src\serialport.cpp) [C:\Enseignements\2015\miniSe
rverMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2039: 'FreeCallback' : is not a member of 'node' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modu
les\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2061: syntax error : identifier 'FreeCallback' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_module
s\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'callback' : undeclared identifier (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\john
ny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'hint' : undeclared identifier (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-f
ive\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(672): error
C2665: 'node::Buffer::New' : none of the 4 overloads could convert all the argument types (..\src\serialport.cpp) [C:\E
nseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(43): could be 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,char *,size_t)'
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(31): or 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,v8::Localv8::String,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(676): error
C2664: 'v8::Localv8::Object::Local(const v8::Localv8::Object &)' : cannot convert argument 1 from 'v8::MaybeLocal<v
8::Object>' to 'const v8::Localv8::Object &' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules
\johnny-five\node_modules\serialport\build\serialport.vcxproj]
Reason: cannot convert from 'v8::MaybeLocalv8::Object' to 'const v8::Localv8::Object'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be cal
led
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C2039: 'Use' : is not a member of 'node::Buffer' (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modul
es\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C3861: 'Use': identifier not found (..\src\serialport.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-five
\node_modules\serialport\build\serialport.vcxproj]
..\src\win\enumser.cpp(443): warning C4996: 'GetVersionExA': was declared deprecated [C:\Enseignements\2015\miniServerM
M\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433) : see declaration of 'GetVersionExA'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(263): error
C2995: 'v8::Local _NanEnsureLocal(v8::Local)' : function template has already been defined (..\src\serialport_win
.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(25
6) : see declaration of 'NanEnsureLocal'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C3083: 'smalloc': the symbol to the left of a '::' must be a type (..\src\serialport_win.cpp) [C:\Enseignements\2015\mi
niServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2039: 'FreeCallback' : is not a member of 'node' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node

modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(661): error
C2061: syntax error : identifier 'FreeCallback' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_mo
dules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'callback' : undeclared identifier (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_modules
johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(665): error
C2065: 'hint' : undeclared identifier (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\john
ny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(672): error
C2665: 'node::Buffer::New' : none of the 4 overloads could convert all the argument types (..\src\serialport_win.cpp) [
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(43): could be 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,char *,size_t)'
C:\Users\Alexandre.node-gyp\4.1.1\include\node\node_buffer.h(31): or 'v8::MaybeLocalv8::Object node:
:Buffer::New(v8::Isolate *,v8::Localv8::String,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(676): error
C2664: 'v8::Localv8::Object::Local(const v8::Localv8::Object &)' : cannot convert argument 1 from 'v8::MaybeLocal<v
8::Object>' to 'const v8::Localv8::Object &' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_mod
ules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
Reason: cannot convert from 'v8::MaybeLocalv8::Object' to 'const v8::Localv8::Object'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be cal
led
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C2039: 'Use' : is not a member of 'node::Buffer' (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_m
odules\johnny-five\node_modules\serialport\build\serialport.vcxproj]
C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\node_modules\nan\nan.h(683): error
C3861: 'Use': identifier not found (..\src\serialport_win.cpp) [C:\Enseignements\2015\miniServerMM\node_modules\johnny-
five\node_modules\serialport\build\serialport.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:2
70:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\Enseignements\2015\miniServerMM\node_modules\joh
nny-five\node_modules\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64\serialport.node" "--module_n
ame=serialport" "--module_path=C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialpor
t\build\serialport\v1.7.4\Release\node-v46-win32-x64"
gyp ERR! cwd C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Enseignements\2015
miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64\serialp
ort.node --module_name=serialport --module_path=C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules
\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\nod
e_modules\serialport\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:817:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.10240
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Enseignements\2015\miniServerMM\node_modules\jo
hnny-five\node_modules\serialport\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport
node-pre-gyp ERR! node -v v4.1.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.7
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Enseignements\2015\miniServerMM\node_modules\johnn
y-five\node_modules\serialport\build\serialport\v1.7.4\Release\node-v46-win32-x64\serialport.node --module_name=serialpo
rt --module_path=C:\Enseignements\2015\miniServerMM\node_modules\johnny-five\node_modules\serialport\build\serialport\v1
.7.4\Release\node-v46-win32-x64' (1)
npm WARN optional dep failed, continuing [email protected]

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

@AlexDmr Node.js 4.x support is in progress.

from johnny-five.

Alexaas avatar Alexaas commented on July 22, 2024

@rwaldron Could you please give an update here once it should work with Node.js 4.x?

from johnny-five.

dtex avatar dtex commented on July 22, 2024

@rwaldron I propose creating an issue for node 4.x support that details the state of things that we can just point everyone to. Much like @jacobrosenthal did over on the serialport repo. I'm traveling all day, but will write one up tonight.

from johnny-five.

playteka avatar playteka commented on July 22, 2024

@rwaldron , @ThomasDeutsch , @voodootikigod , I think ask people to install visual studio just for installing johnny-five is too heavy. VS is around 10GB. Can you think about light solution like gcc(mingw) on windows?

from johnny-five.

rwaldron avatar rwaldron commented on July 22, 2024

That hasn't been necessary for almost two years—serialport auto builds pre-compiled binaries for every release

from johnny-five.

dtex avatar dtex commented on July 22, 2024

We need to update the wiki

from johnny-five.

vitaliyazvinski avatar vitaliyazvinski commented on July 22, 2024

@playteka @rwaldron
No need to install whole VS, windows build tools is enough:
npm --add-python-to-path install --global --production windows-build-tools
It will install python and will add it into PATH. It was enough to start blink example.
BTW it works on node v6.11.2 x64

from johnny-five.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.